Skip to content

Guess My Number is a classic game designed to entertain and challenge players of all ages. The objective of the game is to correctly guess the hidden number, which is randomly generated by the computer. Players can input their guesses and receive feedback on whether their guess is too high, too low, or correct.

Notifications You must be signed in to change notification settings

tucecifci/Guess-My-Number

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Guess-My-Number

Hello everybody! 👋
✨ Welcome to the Guess My Number game! This game is a simple JavaScript-based guessing game where players attempt to guess a randomly generated number within a specified range. Guess My Number is a classic game designed to entertain and challenge players of all ages. The objective of the game is to correctly guess the hidden number, which is randomly generated by the computer. Players can input their guesses and receive feedback on whether their guess is too high, too low, or correct.

👀 Overview

📷 Screenshot

screencapture-tucecifci-github-io-Guess-My-Number-2024-03-30-14_14_58

screencapture-tucecifci-github-io-Guess-My-Number-2024-03-30-14_16_19

screencapture-127-0-0-1-3000-index-html-2024-03-30-14_13_05

🔗 Links

My process

💡 Built with

The Guess My Number game is built using the following technologies:

  • HTML5: Used for structuring the webpage content and layout.
  • CSS3: Used for styling the game interface, including colors, typography, and layout.
  • JavaScript: Used for implementing the game logic, including random number generation, user input handling, and feedback generation.

🧠 What I learned

While working on this project, I learned:

  • How to structure HTML documents effectively.
  • How to use CSS to style and layout web pages.
  • Techniques for creating responsive designs using media queries.
  • Best practices for organizing and commenting code.
const displayMessage = function (message) {
  document.querySelector(".message").textContent = message;
};
  displayMessage("Start guessing...");
  document.querySelector("body").style.backgroundColor = "#222";
  document.querySelector(".number").style.width = "15rem";
  document.querySelector(".guess").value = "";
  document.querySelector(".number").textContent = "?";
});

👩🏼‍💻 Features

The Guess My Number game offers the following features:

  • Random Number Generation: The computer generates a random number within a specified range, which serves as the target for players to guess.
  • User Input: Players can input their guesses using a text input field.
  • Feedback: After each guess, players receive feedback on whether their guess is too high, too low, or correct.
  • Win/Lose Condition: The game ends when the player correctly guesses the number or exhausts all attempts, with appropriate messages displayed for each outcome.

🤔 How to Play

To play the Guess My Number game:

  1. Open the index.html file in your web browser.
  2. Specify the range of numbers within which the hidden number will be generated.
  3. Input your guess in the provided text input field and submit it.
  4. Receive feedback on whether your guess is too high, too low, or correct.
  5. Continue guessing until you correctly guess the hidden number or exhaust all attempts.

🤌🏻 Useful resources

🙏 Special Thanks

  • Jonas Schmedtmann

🏳️‍🌈 Author

About

Guess My Number is a classic game designed to entertain and challenge players of all ages. The objective of the game is to correctly guess the hidden number, which is randomly generated by the computer. Players can input their guesses and receive feedback on whether their guess is too high, too low, or correct.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published