Question: Write a program to play a guessing game between another player and your program. Your program will start by initializing an array to 5 fixed

Write a program to play a guessing game between another player and your program. Your program will start by initializing an array to 5 fixed values in the ranges of 1-1000 in the array. These values should also be in order (sorted).

Your program will then begin by asking the player to make a guess from 1-1000. For the first guess of the user, your program will only tell the player if they guessed correctly or not. However, the program will keep track of how close they are to the closest element in the array. The program will then go into a loop, asking the player for a new guess each time. If at any time, their new guess is farther away from the closest number than their previous guess, the program will respond with “Getting colder!”. If they get closer to a correct guess, the program should respond with “Getting warmer!”. This should continue until the player guesses one of the numbers in the list. Your program should then output “Success!” and then end.

Step by Step Solution

3.42 Rating (149 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

To create a guessing game as described we can break down the program into manageable steps Below is a stepbystep guide and the corresponding Python co... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Document Format (2 attachments)

PDF file Icon

609b209c24447_31351.pdf

180 KBs PDF File

Word file Icon

609b209c24447_31351.docx

120 KBs Word File

Students Have Also Explored These Related Programming Questions!