#ABOUT THE GAME
A user is expected to choose a random number between 0 and 9, click on the button make a guess. The computer on the next tile also picks a pseudo random number which is thereafter compared to an unknown target number and based on the proximity of the two chosen random numbers, a winner is selected. Then the unknown target number is revealed to the user who then has the option of playing again by clicking on the next round button at the buttom of the screen. Upon a successful round, the score tally is increased for the user or the computer depending on who wins.
FOR EXAMPLE:
- Game starts, User selects 5 and clicks the "Make a guess" Button.
- The computer picks a random(say 4) which is unknown to the user at this time.
- After the user clicks make a guess, the computer generates a seperate number(target number) say 2 then thereafter the two players(User and Computer) is compared to the target number, the player whose guess is closer wins.
- Meaning in this example, the computer wins as 4 is closer to 2 than 5. Therefore, the program alerts "computer wins" and increase the computer's score tally then the user has the option to play again and so on.
#IMPLEMENTATION
The program is implemented using html, Css, Javascript. The DOM model in javascript is heavily utilised in the file Game.js and is properly commented for ease of revision and understanding.