Skip to content

IkwukaCySec/rust_guessing_game

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 

Repository files navigation

🎯 Rust Guessing Game

A simple command-line number guessing game written in Rust. This project demonstrates core Rust concepts such as user input handling, control flow, pattern matching, and random number generation.


📌 Project Overview

The program generates a random number between 1 and 100, and the user attempts to guess it. After each guess, the program provides feedback:

  • 📉 Too small
  • 📈 Too big
  • 🎉 Correct guess (win)

The game continues in a loop until the correct number is guessed.


🚀 Features

  • Random number generation using the rand crate
  • Robust input handling and validation
  • Continuous game loop until the correct guess
  • Clear user feedback using pattern matching

🛠️ Technologies Used

  • Rust (stable)
  • rand crate

▶️ How to Run

cargo run

🎓 Key Concepts Demonstrated

  • Input handling (stdin)
  • Error handling with match
  • Pattern matching
  • Loops and control flow
  • Random number generation
  • Basic function decomposition (clean architecture)

💡 Future Improvements

  • Add attempt counter
  • Add difficulty levels
  • Add timer or scoring system
  • Convert to a GUI or web app

👨‍💻 Author

Ikwuka Okoye Aspiring Cybersecurity Analyst & Rust Software Engineer


This project is part of my Rust learning journey and showcases foundational programming concepts in a clean and professional way.

About

This game continues in a loop, in the command line; generating random numbers (from 1 to 100), until the correct number is guessed.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages