src/main.rs aktualisiert

This commit is contained in:
robin 2024-06-07 13:40:19 +02:00
parent 2a7cc8269e
commit 0a8c1d9a98

View file

@ -12,10 +12,10 @@ fn main(){
.read_line(&mut guess)
.expect("Failed to read line");
if guess.trim().is_empty() {
println!("Du kannst nicht cheaten");
std::process::exit(0);
println!("Die opiton ist unknown");
}
else {
let guess: u32 = guess.trim().parse().expect("Please type a number!");
if guess == secretnumber {
println!("Dein score: {}", score);
@ -29,6 +29,8 @@ fn main(){
println!("Du hast überlebt");
let _score = score += 1;
println!("Der Geist ist hinter der Tür {}", secretnumber);
}}
}
}
}
println!("Du hast gewonnen");
}