Instructions
What you are building
You will build a game called Paladin Number Guess. The computer picks a secret number from 1 to 100. The player keeps guessing until they get it. After each guess, the game gives a hint: Too high, Too low, or Very warm. At the end, it shows how many guesses it took and a score.
The template file walks you through 11 short steps. Each step tells you exactly what to type and shows an example. The whole program is about 25 lines of code, so you can finish it in one class period.
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 picks a different secret number 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
secret_numberandguesses. 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 6, 7, and 8 go inside the while loop, so they start with 4 spaces. Steps 9 and 10 have no spaces at the start.
- Testing is faster if you can see the secret number. The template shows a line you can add while testing. Delete it before you upload.
- 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 11 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.