Skip to content

R-100/Rust-Guess-The-Number

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Rust Guess The Number

Rust License

A simple console game written in Rust where the computer selects a random number between 1 and 100. The player tries to guess the number and receives hints indicating whether the target number is higher or lower. The number of attempts is tracked, and the game can be replayed after each round.

Features

  • Random number between 1 and 100
  • Hints (“higher” / “lower”)
  • Tracks number of attempts
  • Input validation
  • Replay functionality

Installation

git clone https://github.com/R-100/Rust-Guess-The-Number.git
cd <your-project-folder>
cargo run

How to Play

  1. Start the program
  2. Type yes to begin
  3. Guess the number (between 1 and 100)
  4. Follow the hints
  5. Try to guess the number in as few attempts as possible
  6. Replay with yes or exit with no

File Structure

src/
├── main.rs        
Cargo.toml
Cargo.lock
README.md

About

A simple “Guess the Number” game written in Rust. The program generates a random number between 1 and 100, and the player tries to guess it. It provides hints (“higher” or “lower”) and tracks the number of attempts. Includes replay functionality and input validation.

Topics

Resources

License

Stars

Watchers

Forks

Contributors

Languages