"A fun and interactive Number Guessing Game built with JavaScript. It uses random number generation and logic to guide the user to the correct answer. 🎮"
Welcome to the Number Guessing Game! This is a simple logic-based game where the computer selects a random number between 0 and 100, and the player has to guess it.
- Random Number Generation: Uses
Math.random()to generate a new challenge every time. - Smart Hints: Tells the user if their guess is "Too Big" or "Too Small".
- Infinite Loop: The game continues until you find the correct number.
- The computer picks a number between 0 and 100.
- The user is prompted to enter a guess.
- If the guess is correct, the user wins! 🏆
- If not, the game provides a hint and asks for another guess.
- Open any web browser (Chrome, Firefox).
- Press
F12to open Developer Tools. - Go to the Console tab.
- Copy and paste the code from
index.jsand press Enter.
Note: Since
prompt()is a browser function, if you run this in Node.js/GitHub Codespaces, you will need to replacepromptwith a library likeprompt-sync.
game.js: Contains the main game logic.README.md: Project documentation.
- JavaScript Games
- Logic Building in JS
- Math.random JavaScript
- Programming Exercises for Beginners