CSci 157 - Lab 7

Purpose: the main objective is to continue to work with selection statements and the graphics classes in the context of a very simple game. Random number generators, in particular, are used extensively in game programming. Be creative and see what you can do with them.

Reminders and Warmup Questions:

Note: Warmup questions are discussion questions...you don't need to write anything down.

  1. Don't try to program everything at once. Set up the overall program first, then add/change things until things look right. One goal is to always have something that runs, even if it isn't complete, as you work on it.
  2. To get credit for completing lab during the session, be sure to demonstrate each program as requested in the directions, so the instructor can record completion of the lab.
  3. What module needs to be imported for the sqrt function? What module do you need to generate random numbers?
  4. How might you construct a bullseye target with three different rings? If we try layering three different objects, which object contains a point in all three?
  5. How can a program tell if a point is contained inside a circle?


  I. A Dart game

Download the program darts.py - this program contains a basic framework for you to fill in. The final program will use random number generation to create your own "game" of darts.

Reminder - always do this at the end of labs
Make sure both team members have a copy of the programs developed in this lab.