17 lines
492 B
Rust
17 lines
492 B
Rust
use rand::Rng;
|
|
loop {
|
|
println!("Vor dir sind drei Türen");
|
|
println!("Eine von ihnen tötet dich ");
|
|
println!("Durch welche gehst du?");
|
|
println!("Gib eine Zahl zwischen 1 und 3 ein");
|
|
let mut secretnumber = rand::thread_rng().gen_range(1..=3);
|
|
let mut guess = String::new();
|
|
if guess > 3 {
|
|
println!("Die Tür gibt es nicht");
|
|
}; else if guess = secretnumber{
|
|
println!("Du bist tot");
|
|
return false
|
|
}
|
|
|
|
|
|
} |