https://github.com/shivankushsingh09/number-guessing-game
The Number Guessing Game is an interactive C program where the player guesses a random number. Feedback is given for each guess: "Lower number, please" if too high, and "Higher number, please" if too low. The game displays the total attempts upon a correct guess, using loops and a random number generator for an engaging experience.
https://github.com/shivankushsingh09/number-guessing-game
basic-game c-programming-game guess-challenge guessing-game guessing-logic interactive-game number-guess number-match number-prediction simple-game
Last synced: 4 months ago
JSON representation
The Number Guessing Game is an interactive C program where the player guesses a random number. Feedback is given for each guess: "Lower number, please" if too high, and "Higher number, please" if too low. The game displays the total attempts upon a correct guess, using loops and a random number generator for an engaging experience.
- Host: GitHub
- URL: https://github.com/shivankushsingh09/number-guessing-game
- Owner: shivankushsingh09
- License: mit
- Created: 2024-07-18T16:01:35.000Z (11 months ago)
- Default Branch: main
- Last Pushed: 2024-07-26T04:55:57.000Z (11 months ago)
- Last Synced: 2025-01-16T07:55:39.972Z (5 months ago)
- Topics: basic-game, c-programming-game, guess-challenge, guessing-game, guessing-logic, interactive-game, number-guess, number-match, number-prediction, simple-game
- Language: C
- Homepage: https://www.w3schools.com/c/
- Size: 10.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: License.md
Awesome Lists containing this project
README
# Introduction
A simple console-based Number Guessing Game developed in C. The game generates a random number, and the player has to guess it within a limited number of attempts.
## Table of Contents
- [Features](#features)
- [Technologies Used](#technologies-used)
- [Installation](#installation)
- [Usage](#usage)
- [Contributing](#contributing)
- [License](#license)
- [Contact](#contact)## Features
- Generates a random number within a specified range.
- Provides feedback on whether the guess is too high or too low.
- Limits the number of attempts.
- Displays the number of attempts and the result of the game.## Technologies Used
- **Programming Language:** C
## Installation
To compile and run the Number Guessing Game, follow these steps:
1. **Clone the repository:**
```bash
git clone https://github.com/shivankushsingh09/Number-Guessing-Game.git
cd Number-Guessing-Game```
2. **Compile the program:**
You can compile the program using gcc. Run the following command in the terminal:
```bash
gcc -o number_guessing_game number_guessing_game.c
```3. **Run the program:**
After compiling, you can run the executable:
```bash
./number_guessing_game
```## Usage
1. Start the Game:
- When you run the program, it will prompt you to guess a number within a predefined range.
2. Input Your Guess:
- Enter your guess when prompted. The program will indicate whether your guess is too high or too low.
3. Try to Guess the Number:
- Continue guessing until you either guess the correct number or run out of attempts.
4. Game Over:
- If you guess the number correctly, the game will congratulate you and display the number of attempts. If you run out of attempts, the game will reveal the correct number and end.
## Example
Welcome to the Number Guessing Game!
Guess a number between 1 and 100: 50
Your guess is too low. Try again.Guess a number between 1 and 100: 75
Your guess is too high. Try again.Guess a number between 1 and 100: 62
Congratulations! You guessed the number in 3 attempts.## Contributing
Feel free to contribute to this project by submitting issues or pull requests. If you have suggestions for improvements or features, please open an issue to discuss them.
## License
This project is licensed under the MIT License. See the [LICENSE](https://github.com/shivankushsingh09/Number-Guessing-Game?tab=MIT-1-ov-file) file for details.
## Contact
For any inquiries or feedback, please contact:
- Name: Shivankush Singh
- Email: [email protected]
- GitHub: https://github.com/shivankushsingh09