Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Programming Assignment #1: Guessing Game (Due before class on Friday, Jan. 31) Write a program to implement the following high-low number guessing game. Use from
Programming Assignment #1: Guessing Game (Due before class on Friday, Jan. 31)
Write a program to implement the following high-low number guessing game.
- Use "from random import randint" and the "randint(1,100)" function to generate a random number between 1 and 100. (Hint: For testing your game it's good to print the answer that the player should be guessing. Of course when it's all working you will want to comment out that print statement.)
- Let the user try to guess the number and say whether the guess is too high, too low, or correct.
- Let the user try to guess over and over until they get the right answer (or run out of guesses).
- Keep score and report how many tries the user needed.
- Implement a way for the player to fail at the game. (Perhaps only 3-4 guesses allowed?)
- For a B: Let the player play multiple times and keep track of the high score of all tries.
- For an A: Use a file to store the top three highest scores and player names, so that they get remembered even when the program is stopped and restarted.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started