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.
- Multi-Module Architecture: Clean code separation using Rust's module system (
main,input_handler,number_gen, andhelper). - 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/yesorn/noinputs like a pro.
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