Skip to content

siyametj/simple_rust_number_guessing_game

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

7 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🎯 Ultimate Rust Number Guessing Game πŸ¦€

Welcome to the Ultimate Number Guessing Game built from scratch using Rust! This project is designed with a clean, modular architecture and features robust input validation, dynamic round tracking, and a smooth terminal interface experience.


πŸš€ Features

  • Multi-Module Architecture: Clean code separation using Rust's module system (main, input_handler, number_gen, and helper).
  • Defensive Input Handling: Built-in validation that rejects empty spaces, non-integer gibberish, and prevents infinite loops on EOF/interruption.
  • Smart Round Tracker: Keeps track of your current round and consecutive wins.
  • Terminal Auto-Cleaner: Automatically flushes and clears the screen between rounds for a native game feel.
  • Play Again Loop: Seamless replay prompt that validates y/yes or n/no inputs like a pro.

πŸ“‚ Project Structure

random_number_guessing/
β”œβ”€β”€ Cargo.toml
β”œβ”€β”€ README.md
└── src/
    β”œβ”€β”€ main.rs          # Main game loop & orchestration
    β”œβ”€β”€ input_handler.rs # Safe integer & string input takers
    β”œβ”€β”€ number_gen.rs    # Random number generator logic
    └── helper.rs        # Terminal screen utility functions

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages