Question: Use JavaScript to create a simple number guessing game. Requirements: 1. Using HTML, CSS and JavaScript, create a game that does the following: 2. Prompts

Use JavaScript to create a simple number guessing game.

Requirements: 1. Using HTML, CSS and JavaScript, create a game that does the following:

2. Prompts the player to select a number between 1 and 100.

3. The number is validated to be between 1 and 100. Display alert boxes for errors and re-prompt for number.

4. If the correct number is not entered, prompts the player to select a higher or lower number.

5. The process is repeated until the player guesses the number.

6. A running list of guesses are displayed on the screen.

7. When the game is complete, the number of guesses are displayed to the player.

8. All input from the user will take place using the prompt method and output using the document.write method. The Math.random function should be used to generate a random number.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock 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 Databases Questions!