Number Guess Challenge
Create a Number Guessing Game
Below is a generic example:
Core Functionality
- The "between" line shall keep track of what numbers the guess needs to be between (updated based on guesses)
- A guess of 1 or 100 is valid
- A guess of a previously guessed number (or out of bounds number) is no longer valid and should not count against the number of guesses. User should see a message reminding them of the "between" bounds.
- Add difficulty level to your game
- Prior to starting a game, user can select a difficulty level (make at least 3 levels)
- Use a dropdown or radio buttons for this functionality.
- Include images that represent the difficulty level
- Once the level has been chosen and a guess has been made, the difficulty level cannot be changed.
- The difficulty level chosen determines how many tries the user has before the lose condition.
- The "Guess in 6 Tries" box is meant for feedback on the guess. Change the message appropriate to the result of the most recent guess.
- Change the color of the "Guess in 6 tries" text to the appropriate message and the color as follows:
- If the guess is too high, RED
- If the guess is too low, BLUE
- If the guess is correct, GREEN
- If the guess is invalid, BLACK
- Count the number of guesses the user has consumed. Do not count invalid guesses.
- If the number of guesses hits the difficulty threshold, the person loses
- If the person guesses the number prior to running out of guesses set by the difficulty setting, the person wins. Display the number of guesses taken.
- Make it look good (CSS)
- Make the page responsive! The customer wants to view on desktop and mobile!
- Hint: Use the
Math.floor
and Math.random
to generate a random number as found here: https://www.w3schools.com/jsref/jsref_random.asp