A guessing game in Rust
If you'd like to learn Rust, The Book from Rust's official website, is freely available and quite good. I've gotten to chapter 10ish so farband have adapted the book's guessing game to flex my newfound skills. Here's that game . secret_numbers.rs defines the SecretNumber struct, representing a guessable secret number and Accuracy , representing how arbitrarily close to the guess a given number is. Some interesting points are the derived traits automatically provided by the compiler by decorating the Accuracy enum with #[derive(PartialEq, Eq, Hash)] . PartialEq and Eq implements functionality to compare values and, well - if you don't have it (or your own implementation), the compuler will tell you error[E0277]: can't compare secret_number::Accuracy with secret_number::Accuracy --> src\secret_number.rs:12:10 | 12 | #[derive(Eq, Hash, Debug)] | ^^ no implementation for secret_number::Accuracy == secret_number::Accuracy | = help: the trai