The player will guess a random number between 1 and 100. They have a certain number of tries to guess the correct number.
If they guess the number within the number tries then they win, otherwise they lose.
More details for the implementation of this challenge can be found in script.js
You can find an example working website here:
https://waba-tron.github.io/Guess-The-Number-Game/Hi-lo.html
Fork this repository and then open in VSCode. To view the website, open index.html in a browser.
Students must understand
- How to retrieve elements from the DOM
- How to use an if statement
- How to use event listeners
Develop the application further and display the number of tries taken for the user to guess the number.
If the user guesses the random number within the number of tries, print 'It took you ' + TriesTaken + ' tries';
Lets make our application a little cooler, incorporate a 'tries' functionality, where a user only has certain number of tries to guess the number.
If the user were to exceed the number of tries the print out a message print 'You Lose, the number was ' + randomNumber;