Course Home | Homework | Lab Open Hours | Programming | Schedule & Lecture Notes | Submit | Turing Access

Saint Louis University

Computer Science 150
Introduction to Object-Oriented Programming

Michael Goldwasser

Fall 2006

Dept. of Math & Computer Science

Programming Assignment 03

Checkers

Due: 8:00pm, Tuesday 10 October 2006


Contents:


Overview

The goal of this assignment is to create an image of an initial checkerboard configuration, such as the following:

Required appearance

In terms of the end result, you must do the following:

Required techniques

Equally important in this assignment is your technique. You must make legitimate use of control structures to exploit the obvious patterns which exist in the board.

Given that the end result is fixed, it would be possible for someone to write code which technically works by individually drawing each of the 64 squares and each of the 24 circles. But you will not receive full credit for such an approach.

As a general rule, if you ever find yourself "cutting-and-pasting" code from one part of a program to another, there is a better way to express the repetition!


Collaboration Policy

For this assignment, you must work individually in regard to the design and implementation of your project.

Please make sure you adhere to the policies on academic integrity in this regard.


Submitting Your Assignment

You should create a new file, checkers.py, which contains all of your own code. This file must be submitted electronically.

You should also submit a separate 'readme' text file, as outlined in the general webpage on programming assignments.

Please see details regarding the submission process from the general programming web page, as well as a discussion of the late policy.


Grading Standards

The assignment is worth 10 points.


Extra Credit

For the required portion of the assignment, we did not make any requirements about the overall size of the board. For extra credit, we want you to write your program in a way that scales your picture to a desired window size.

Specifically, when executing your program, you should first prompt the user for the desired width of the window, measured in pixels. Since the board is presumed to be square, you need not explicitly ask for the height of the board. Once you have received that input, create such a window and draw the checkerboard accordingly.

Truly Impressive Design

If your program is well-written, you should be able to use it to not only create the standard 8x8 checkerboard, but to create an NxN checkerboard pattern for any (even) value of N. Let's presume that we wish to define the rules for an NxN game so that each player starts with three rows of checkers (namely the top three rows and the bottom three rows, respectively). For example, here is an image of a hypothetical 20x20 game of checkers.

To meet this goal, ask the user of the software to enter a value for N.


Michael Goldwasser
Last modified: Wednesday, 11 October 2006