|
|
|
@ -5,9 +5,9 @@ use std::io;
|
|
|
|
|
fn main() {
|
|
|
|
|
println!("Guess the number!");
|
|
|
|
|
|
|
|
|
|
let secret_number = rand::thread_rng().gen_range(1..101);
|
|
|
|
|
let secret_number = rand::thread_rng().gen_range(1..=100);
|
|
|
|
|
|
|
|
|
|
println!("The secret number is: {}", secret_number);
|
|
|
|
|
println!("The secret number is: {secret_number}");
|
|
|
|
|
|
|
|
|
|
println!("Please input your guess.");
|
|
|
|
|
|
|
|
|
@ -22,7 +22,7 @@ fn main() {
|
|
|
|
|
|
|
|
|
|
let guess: u32 = guess.trim().parse().expect("Please type a number!");
|
|
|
|
|
|
|
|
|
|
println!("You guessed: {}", guess);
|
|
|
|
|
println!("You guessed: {guess}");
|
|
|
|
|
|
|
|
|
|
match guess.cmp(&secret_number) {
|
|
|
|
|
Ordering::Less => println!("Too small!"),
|
|
|
|
|