Instructions
What you are building
You will build a dice game called Paladin Dice Duel. You and the computer each roll a die. The higher roll wins the round. The first player to win 3 rounds wins the game, and the winner gets 2 random prizes.
You do not have to figure it out alone. The template file walks you through 16 short steps. Each step tells you exactly what to type and shows an example.
What you need
- Visual Studio Code with the Python extension installed.
- The template file from this page (you get it after you click Start Assignment).
How it works
- Sign in: enter your first name, last name initial, and class period. Click Start Assignment. Your start time is recorded.
- Download the template file and open it in VS Code.
- Follow the steps in the green comments. Type your code under each
YOUR CODE:line. Save and run after every step. - Upload your .py file here. The checklist shows your points for every step. Click Hint on any step for help.
- Fix and re-upload as many times as you want.
- Submit for your final score. Turn in your score report the way your teacher tells you.
What a finished game looks like
Blue text is what the player types. Your game will roll different numbers every time.
Grading rubric: 30 points
Each step in the template is worth points. The checker reads the structure of your code. Words inside comments or quotes do not count, so deleting the # in front of an example is not enough if the indentation is wrong. Your code is never run on this page.
| Step | What the checker looks for | Points |
|---|---|---|
| Total | 30 |
Tips for success
- Use the exact variable names from the template, like
player_winsandcomputer_roll. The checker looks for them. - Save and run after every step. It is much easier to fix one small mistake than ten.
- If VS Code shows red error text, read the last line first. It tells you what is wrong and the line number.
- Indentation matters. Steps 8 to 11 go inside the while loop, so they start with 4 spaces. Steps 12 to 15 have no spaces at the start.
- Stuck in a loop that never ends? Click in the VS Code terminal and press Ctrl+C.
Student Information
Part 1Download the Template
Part 2Build It in VS Code
- Open VS Code. Click File > Open File... and choose the template you just downloaded (look in your Downloads folder).
- Read STEP 1 in the green comments. Type the code on the blank lines under
YOUR CODE:. - Press Ctrl+S to save. Click the ▷ Run Python File button at the top right to test it. The game runs in the Terminal at the bottom of VS Code.
- Move on to the next step. Repeat until all 16 steps are done.
- You can upload your file below at any time to see how many points you have so far.
Part 3Upload and Check
Part 4Submit
When your checklist looks good, submit your score. You can still upload a new version and submit again afterward.