Computer Science 2024 Home Assignment: Guess the Number - High Scores Due 11/13 at 11:59
To practice loading and saving files, you will extend the Guess the Number project to incorporate persistent high scores. I highly recommend that you make a copy of the project and edit the copy instead of editing the original project directly.
Your program must meet the following requirements:
Meet requirements for original Guess the Number project
When the game ends, load previous scores from a file located in a data/ directory (if available)
There should be a different file for each difficulty level
Tell the user where they ranked against the previous scores
Only compare against the selected difficulty level
Save the scores (including the new one) to a file in the data/ directory
Make sure to save in the file associated with the selected difficulty level
It’s up to you to decide how to name the files, as well as which module you prefer to save and load the data with.
If you use the pickle module, make sure to use either rb, wb, or ab file modes since pickle does not save data in plaintext format .
Review the week 9 slide deck for an example of how to use pickle and json modules.
Extra Challenges (optional)
Save cumulative statistics to another file
Number of times each difficulty has been played
Percentage of guesses that were too high
Percentage of guesses that were too low
Allow users to enter their initials
Print initials and scores of top 5 scores at the end of the game
Submit Assignment
When your program meets the requirements, download and submit your .py file here:
Submit Assignment