Question: Write a script le to play a simple number guessing game as follows. The script should generate a random integer in the range 1, 2,

Write a script le to play a simple number guessing game as follows. The script should generate a random integer in the range 1, 2, 3, . . . , 14, 15. It should provide for the player to make repeated guesses of the number, and it should indicate if the player has won or give the player a hint after each wrong guess. The responses and hints are as follows:

■ “You won” and then stop the game.

■ “Very close” if the guess is within 1 of the correct number.

■ “Getting close” if the guess is within 2 or 3 of the correct number.

■ “Not close” if the guess is not within 3 of the correct number.

Step by Step Solution

3.52 Rating (165 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

To create a simple number guessing game script you can choose between various programming languages ... 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

Students Have Also Explored These Related Introduction Mechanical Engineering Questions!