Skip to content

CodeYouOrg/webdev-js-intro-final

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Introduction to JS: Guess the Number

Overview

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.

Instructions

Prerequisites

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

Cloning the Repository

Follow these steps to fork and clone the repository:

  1. Open your terminal or Git Bash.
  2. Navigate to the directory where you want to store the project.
  3. Fork the repository.
  4. Clone the forked repository to edit on your local computer.

Viewing the Project

To view the project locally, you can either open the project files in your code editor or open the HTML files in your browser.

Tasks

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.

Tips

  • 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.

Submitting Your Work

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.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published