Skip to content

Number Guessing Game is a C program where players guess a random number between 1 and 100. With up to 10 attempts, users receive feedback on whether their guesses are too high or low. It's a fun and interactive way to test your guessing skills!

Notifications You must be signed in to change notification settings

rkstudio585/number-guessing-game

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

Number Guessing Game 🎲


In Python

Logo


Welcome to the Number Guessing Game! This is a simple C program where you try to guess a randomly selected number between 1 and 100. It's a fun way to test your guessing skills and see how many attempts it takes you to get it right!

📜 Description

The game generates a random number between 1 and 100. Your goal is to guess this number. The game will provide feedback on whether your guess is too high or too low and will keep track of the number of attempts you make. You have a maximum of 10 attempts to guess the number correctly.

🛠️ Features

  • Random number generation between 1 and 100.
  • Feedback on whether your guess is too high or too low.
  • Attempt counter with a maximum of 10 attempts.
  • Friendly and engaging output format.

🚀 Getting Started

Follow these instructions to get the game up and running on your local machine.

Prerequisites

You need to have a C compiler installed on your system. For example, you can use GCC.

Installation

  1. Clone the Repository

    git clone https://github.com/mdriyadkhan585/number-guessing-game
  2. Navigate to the Project Directory

    cd number-guessing-game
  3. Compile the Program

    gcc -o number_guessing_game number_guessing_game.c
  4. Run the Program

    ./number_guessing_game

🎮 How to Play

  1. Start the Game: Run the executable file. The game will generate a random number between 1 and 100.

  2. Make a Guess: Enter your guess when prompted. The program will tell you if your guess is too high or too low.

  3. Continue Guessing: You have a maximum of 10 attempts to guess the correct number.

  4. Win or Lose: If you guess the number correctly within 10 attempts, you'll win the game. If not, the correct number will be revealed at the end.

📖 Example Output

====================================
   Welcome to the Number Guessing Game!
====================================
I have selected a number between 1 and 100.
Can you guess what it is?

Attempt 1/10
Enter your guess: 50
Your guess is too high! Try again.

Attempt 2/10
Enter your guess: 25
Your guess is too low! Try again.

Attempt 3/10
Enter your guess: 37
Congratulations! You guessed the number 37 in 3 attempts.

Game Over
====================================

Repository Profile

Happy guessing! 🎉

About

Number Guessing Game is a C program where players guess a random number between 1 and 100. With up to 10 attempts, users receive feedback on whether their guesses are too high or low. It's a fun and interactive way to test your guessing skills!

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages