Mini Project: Number Guessing Game
Let's build a number guessing game.
The code here will look very similar to the grade calculator you just built.
Like the last project, you don't need to modify anything in index.html
.
Your job is to write the logic for the checkGuess
function defined in
script.js
.
checkGuess
should:
- return
TOO LOW
(all caps) if the guess is less than secretNumber
- return
TOO HIGH
(all caps) if the guess is greater than secretNumber
- return
INVALID GUESS
(all caps) if the guess is less than the lower bound or
greater than the upper bound
- return
CORRECT
(all caps) if the guess is correct
After making changes, be sure to press the play button to load your updated
code.
Tests
Don't forget to test your code by pressing the check mark button. The tests
expect the same output described above.