Skip to content

This is a simple console-based number guessing game implemented in Rust.

Notifications You must be signed in to change notification settings

TrezorTop/rust-guess-number-game

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Guess Game

This is a simple console-based number guessing game implemented in Rust. The game generates a random number between 1 and 100, and the player's task is to guess this number.

Getting Started

To get a local copy up and running, follow these simple steps.

Prerequisites

  • Rust: You need to have Rust installed on your machine. You can download Rust from here.

Installation

  1. Clone the repo
git clone https://github.com/TrezorTop/rust-guess-number-game.git
  1. Change to the project directory
cd rust-guess-number-game
  1. Build the project
cargo build
  1. Run the project
cargo run

Usage

After running the project, you will be prompted to guess a number. Enter a number between 1 and 100. The game will tell you if your guess is too small, too big, or correct. If your guess is correct, you win and the game ends. If your guess is incorrect, you can keep guessing until you find the correct number.

Learning Rust

This project is a great starting point for learning Rust. It covers various aspects of Rust such as:

  • Use of external crates (rand in this case)
  • Basic input/output
  • Error handling
  • Use of match expressions
  • Looping constructs

Feel free to clone this project, explore the code, and modify it to enhance your understanding of Rust.

About

This is a simple console-based number guessing game implemented in Rust.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages