You and a partner will design a simple console game app. For example:
Example
Click Run to play Rock, Paper, Scissors against the computer!
To be considered complete, your program must include each of the following:
main()
function.To boost your score for this assignment, you and your partner can include one or more of the following Bonus Items:
Before you start coding, you and your partner must decide what game you want to create!
Next, describe to each other what you want the program to do. Now is NOT the time to write code! Discuss the GAME, not Python.
Now that you and your partner have chosen a game idea, the next step is to block out the different parts of the program. This can be done with pencil and paper, in a shared document, or with comments in a code editor.
The idea here is to describe how each part of the program works without worrying about the actual Python code yet. This can include an outline of the data and variables needed and/or a short description of the logic for each part of the game (e.g. loops, conditionals, functions, etc.).
Example
For the Rock, Paper, Scissors game above, the outline might look something like:
Login to your Trinket or repl.it account. Start a new project and give it a
descriptive name (something flashier than Assignment 3
). Be sure to share
the link to the project with your partner!
Begin coding your game by following the outline you made in Part 2. Here are a few tips to help you complete your project with less hassle:
Your game is almost complete! You just need to run it a few times to check for any leftover bugs.
Users often enter the wrong thing when prompted. For example, if they are asked
for a number between 1
and 10
, they might enter 100
or the string
'one'
. Your program needs to survive these cases.
Also, you need to check to make sure your program deals with edge cases
correctly. For example, in the range 1 - 10
, the values 1
and 10
are at the edge of the accepted entries. A conditional that checks for
user_choice < 1
behaves differently than one that uses
user_choice <= 1
. This small change in logic can cause unexpected results,
like never being able to select Rock
in the Rock, Paper, Scissors game.
Run your program several times and do the following:
float
or str
when an int
is required).If your program crashes or produces unexpected results during these tests, then you need to find and fix the bugs.
Once you finish this final round of debugging, your game is ready!
Tip
One of the best ways to find bugs in your game is to let someone else play it!
Before you submit your final program, be sure that your code:
Your teacher will provide you with a detailed rubric for this assignment. This describes how each part of the project will be graded, as well as how many points each part can earn.
Your teacher will provide instructions for sharing the URL for your project.