This is a simple Random Number Guessing Game built using HTML, CSS, and JavaScript. The primary focus of this project is to practice DOM manipulation skills and enhance understanding of core web development concepts.
- A randomly generated secret number.
- Input field for users to guess the number.
- Feedback messages to indicate whether the guess is too high, too low, or correct.
- A score counter to track the user's attempts.
- A reset button to restart the game.
- Practicing DOM manipulation using JavaScript.
- Styling the user interface with CSS.
- Handling user inputs and events dynamically.
- Developing interactive features using vanilla JavaScript.
- HTML5: Structure of the web page.
- CSS3: Styling for the game interface.
- JavaScript (ES6): Game logic and DOM manipulation.
To view or modify this project, you only need a web browser and a text editor.
- Clone this repository:
git clone https://github.com/anandku06/random-number-guessing.git
- Navigate to the project directory:
cd random-number-guessing
- Open the
index.html
file in your browser:open index.html
- The computer generates a secret number between a predefined range (e.g., 1 to 100).
- Enter your guess in the input field and press the "Guess" button.
- The game will provide feedback:
- "Too High" if your guess is higher than the secret number.
- "Too Low" if your guess is lower than the secret number.
- "Correct!" if you guess the number.
- Use the "Reset" button to play again.
index.html
: Contains the structure of the game.style.css
: Defines the styling of the game interface.script.js
: Contains the game logic and DOM manipulation.
- Add difficulty levels (easy, medium, hard) with varying number ranges.
- Add a timer to challenge the user.
- Display a leaderboard for high scores.
This project was created as a part of my practice to improve DOM manipulation and basic JavaScript skills. Feel free to use, modify, and learn from this project.