Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version
  1. Create a prompt that asks the player to enter the minimum and maximum numbers for the range of the game.

  2. Store the minimum and maximum values entered by the player in separate variables.

  3. Generate a random number within the range that the player defined using the Math.random() function.

  4. Ask the player to guess a number within the range they specified.

  5. Check if the player’s guess is higher or lower than the generated number and provide feedback accordingly.

  6. Repeat steps 4 and 5 until the player guesses the correct number.

  7. You may also need to add input validation to ensure that the values entered by the player are valid numbers and that the minimum value is less than the maximum value.