Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

README.md

Guess-The-Number-Game

Explanation

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

Example Result

You can find an example working website here:

https://waba-tron.github.io/Guess-The-Number-Game/Hi-lo.html

Installation

Fork this repository and then open in VSCode. To view the website, open index.html in a browser.

Prior Knowledge

Students must understand

  • How to retrieve elements from the DOM
  • How to use an if statement
  • How to use event listeners

Advanced Challenges

Number of Tries

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';

Let The Player Lose

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;