Skip to main content
  1. Teaching/
  2. teaching/

·4 mins

You will prepare a short final project for this class. This is a chance for you to practice applying your Python programming skills to a real world application, and to learn a little more about programming in a specific field.

You may work alone or in pairs on this project. The project will be graded on three things:

  • this proposal (mostly based on completion)
  • the code you submit
  • a short presentation/demo where you show off your project

For this proposal, you should come up with an idea you'd like to implement. I will give you feedback on the scope (e.g. is this too much work? Too little work?) and possibly some hints for libraries to use or techniques to try. Your project must contain the following components:

  • Some sort of user input. This can be from a configuration file, text input in a terminal window, or reading keypresses directly using a library.
  • Some sort of organized output. This can be a graphical window, text output, plots of a system, or even just a nicely-organized table of outputs.
  • An organized internal structure. Use functions, structures, and classes to organize the code as much as possible.

Submit a proposal for your project by Monday, July 18. If you are working in pairs, you may work together on the proposal, but you should both submit a copy on Canvas.

Some ideas for the project:

  • A top-down 2D racing game
  • Simulating a network of chemical reactions with the Gillespie algorithm
  • Computing and visualizing stress in a 2D truss bridge
  • A simple scanner for known malware

If you have other ideas you'd like to explore, bring them to me and we'll see if we can turn them into a workable project proposal!

Your proposal should contain the following elements:

  • Your name (and the name of your partner, if applicable)
  • A description of what you'd like to do
  • How you're going to meet each of the three requirements for the project
  • At least two examples of behaviors you want to implement
  • At least three examples of behaviors you do NOT want to implement

Note that I will use these last two to determine whether you're trying to do too much work, so please don't write silly things for non-implemented behaviors. For example, "simulate the universe since the beginning of time" is probably out of scope for a racing game, but that still leaves the possibility that you're trying to implement Forza 4 in a month, and I won't be able to point out that this is too much work.


Here is an example proposal:

Name: Kevin Song and Imaginary Friend

We would like to implement a toy game of Tetris. Tetris is a retro game where tetrominoes (groups of four blocks) appear at the top of the screen and fall to the bottom. The player must rotate and move the blocks to fill up the playing space: when an entire line of blocks is generated, they disappear, allowing the game to continue. If the player fails to do this, the blocks pile up and eventually cause a game over when a new block cannot be created without touching existing blocks.

For the user input part of the program, we will use PyGame to directly read the user's keypresses. Output will be rendered to a window, also using PyGame's rendering features. For internal organization, we will use Tetromino objects which store their position and a Game class which keeps track of things like the screen state, the number of lines cleared, etc. A main game loop will update the Game and spawn new Tetrominoes as appropriate.

We would like to implement the basic functionality of a single level of Tetris (falling blocks, line clearing, etc) and a game over state. We will not attempt to create a game over screen, keep track of the user's score, or worry about having pretty-looking graphics (the blocks will have very basic colors and drawing).