Exit game after correct guess

This commit is contained in:
Manuel Thalmann 2024-10-12 00:22:11 +02:00
parent cab74a2477
commit f7cbc03210

View file

@ -22,7 +22,10 @@ fn main() {
match guess.cmp(&secret_number) { match guess.cmp(&secret_number) {
Ordering::Less => println!("Too small!"), Ordering::Less => println!("Too small!"),
Ordering::Greater => println!("Too big!"), Ordering::Greater => println!("Too big!"),
Ordering::Equal => println!("You win!"), Ordering::Equal => {
println!("You win!");
break;
},
} }
} }
} }