src/main.rs aktualisiert
This commit is contained in:
parent
2a7cc8269e
commit
0a8c1d9a98
10
src/main.rs
10
src/main.rs
|
@ -12,10 +12,10 @@ fn main(){
|
||||||
.read_line(&mut guess)
|
.read_line(&mut guess)
|
||||||
.expect("Failed to read line");
|
.expect("Failed to read line");
|
||||||
if guess.trim().is_empty() {
|
if guess.trim().is_empty() {
|
||||||
println!("Du kannst nicht cheaten");
|
println!("Die opiton ist unknown");
|
||||||
std::process::exit(0);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
|
||||||
let guess: u32 = guess.trim().parse().expect("Please type a number!");
|
let guess: u32 = guess.trim().parse().expect("Please type a number!");
|
||||||
if guess == secretnumber {
|
if guess == secretnumber {
|
||||||
println!("Dein score: {}", score);
|
println!("Dein score: {}", score);
|
||||||
|
@ -29,6 +29,8 @@ fn main(){
|
||||||
println!("Du hast überlebt");
|
println!("Du hast überlebt");
|
||||||
let _score = score += 1;
|
let _score = score += 1;
|
||||||
println!("Der Geist ist hinter der Tür {}", secretnumber);
|
println!("Der Geist ist hinter der Tür {}", secretnumber);
|
||||||
}}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
println!("Du hast gewonnen");
|
println!("Du hast gewonnen");
|
||||||
}
|
}
|
Loading…
Reference in a new issue