CS21 Lab 12: Game Design

Due 11:59pm Thursday, April 28, 2011

This lab differs from our previous labs in several important ways:

In this lab, you will design and implement a Python game or other Python program. You have significant freedom to choose which game or program you implement, but your project must meet the following requirements:

Run update21 to create the cs21/labs/12 directory. Then cd into your cs21/labs/12 directory and create your python programs for the lab in this directory (handin21 looks for your solutions there).


Choosing a project

As programmers, it is our experience that projects often require more time and more work than we expect before starting the project. Even though you may work with a partner, you should choose a project of similar size and complexity to our recent course labs, such as the Pong, Did You Mean...?, or Mastermind labs.

You do not need to design a fundamentally new game for this project; we recommend that you base your program on an existing idea that you already know. For motivation, you might want to brainstorm for puzzle games, word games, or simple cell phone games that you've previously played.

When considering a project, you should answer the following questions:

Python is extremely well-suited for simple number games or puzzles. Python dictionaries are a good tool for many word games, and the Zelle graphics library might allow you to implement games or other programs that require only combinations of simple shapes. We recommend that you avoid projects that require many distinct pieces or playing cards.

If you want to save your creativity for other pursuits, you may implement one of our sample games instead of choosing your own project. We implemented two sample games: a Fifteen puzzle game that allows a single player to slide numbered squares into an adjacent empty position, and Snake, a game where a single player attempts to eat snake food without hitting the side walls of the game or the rest of the snake.

Unless you implement one of the sample projects above, Jeff or Charlie must approve your project idea. You should email Jeff or Charlie your idea, and they will provide feedback within 36 hours. Your email should contain a general description of the project (you can include external links if there's a good description of the project on the Web), and a brief description of what Python classes you will design and implement for your solution. You can include a more thorough design of your program if you want feedback on that, too, but a complete design is not necessary.


Working with a partner

The best way to work with a partner is to work together in the lab on all parts of the program; this is called pair programming.

If you need to share a file, here are two ways to do this:

$ cd cs21/labs/12
$ mail alice < somefile.py 

$ scp somefile.py alice@lab:cs21/labs/12/.
alice@lab's password: 
somefile.py                      100%   88     0.1KB/s   00:00    
$ 
In the first example the current user emails the file somefile.py to alice; you can replace alice with any email address.

In the second example, scp (secure copy) is used to copy the file somefile.py from the current directory to alice's cs21/labs/12 directory. This requires alice's password and will overwrite any existing somefile.py file in alice's cs21/labs/12 directory.


Submit

Once you are satisfied with your program, one of you and your partner should hand it in by typing handin21 in a terminal window.