Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/swanie21/number-guesser
First Turing Project - Number guesser game
https://github.com/swanie21/number-guesser
css3 html5 number-guesser-game vanilla-javascript
Last synced: 10 days ago
JSON representation
First Turing Project - Number guesser game
- Host: GitHub
- URL: https://github.com/swanie21/number-guesser
- Owner: swanie21
- Created: 2016-07-05T22:24:14.000Z (over 8 years ago)
- Default Branch: gh-pages
- Last Pushed: 2016-08-29T13:40:05.000Z (over 8 years ago)
- Last Synced: 2024-11-11T01:19:54.534Z (2 months ago)
- Topics: css3, html5, number-guesser-game, vanilla-javascript
- Language: JavaScript
- Homepage: http://kirstenswanson.io/number-guesser/
- Size: 76.2 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# number-guesser
Module 1, Project #1 - Created by Adam Bernard & Kirsten Swanson
## Game Introduction
This game requires the player to guess a number that the game has randomly chosen. The range is 0-100 by default, but the player can enter their own range if they wish at the bottom of the page. The game will give the player hints if their guess is too low or too high. Once the player guesses correctly, they're notified of their brilliance and the minimum range decreases by 10 and the maximum range increases by 10 to make the game a little more difficult. To play the game again the player needs to click the 'reset' button and a new number will be generated.
## Game Functionality
On page load the game chooses a random number by the 'Math.random' function between the default range of 1-100. When the player submits their number with the 'guess' button it is displayed in the big yellow box. The player's guess goes through a series of comparisons and is evaluated to check if it matches the random generated number. Below the yellow box there is a hint that displays whether the player guessed too low, too high, or correctly based on the comparisons. If the player guesses correctly they receive a 'You are brilliant' message and both the minimum and maximum ranges are increased by 10, which widens the guessing range making it more difficult. Initially the 'clear' and 'reset' buttons are disabled until the player inputs their guess. In the middle of the game if the player decides to input their own range the previous number guessed and the hint will go away. At any time the player can reset the game, so they are guessing between the range of 1-100 or their own range and the reset will also clear the minimum and maximum range increases.