In this assignment, you will implement the functionality of the "Guess the Number" game. The player will have 3 attempts to guess the randomly generated number within the range of 1 through 10. If you have completed all the previous assignments, you should be able to implement most of the functionality.
Before you begin, ensure you have the following installed:
- Git: Version control system to clone and manage the repository.
- GitHub: make sure you have an account to sync your repositories to.
- Code Editor: Any code editor like Visual Studio Code
Follow these steps to fork and clone the repository:
- Open your terminal or Git Bash.
- Navigate to the directory where you want to store the project.
- Fork the repository.
- Clone the forked repository to edit on your local computer.
To view the project locally, you can either open the project files in your code editor or open the HTML files in your browser.
Before you get started, think about the win and lose conditions of the game.
Win Condition
: Player guesses the correct number within 3 tries.
Lose Condition
: Player guesses incorrectly 3 times.
All elements that will be referenced in app.js
will have an id. Read through index.html
and take note of which elements you will be referencing.
If you get stuck, write psuedocode and break the game's functionality and logic into smaller pieces.
- The span with the id of
guess-message
should output whether the guess is too high, too low, if the player won, or if the player lost. - The span with the id of
current-guess
should output the guess that was just submitted. - The span with the id of
computer-guess
should output the guess that was randomly generated. - The span with the id of
guess-history
should output your guess history. - The "Submit Guess" button should be enabled at the beginning of the game, but when the game is over it should be disabled.
- The "Restart" button should be disabled at the beginning of the game, but when the game is over it should be enabled.
- When the "Restart" button is clicked, all values and text output should reset.
- Push a commit for each task completed. Include a meaningfull commit message.
- Before the above, update the readme task list to track your progress. To do this, enter x between the brackets.
- Get used to using your browser's developer tools now. For now, become familiar with:
- Toggling between desktop mode and device emulation/responsive mode.
- Using inspector mode to inspect elements.
- If you get stuck, please remember that you have various resources available to you.
After completing the assignment, make sure to commit your changes and push them back to your own repository and turn in the GitHub link in Google Classroom.