main.rs aktualisiert
This commit is contained in:
parent
b0d309330e
commit
51c9af4501
20
main.rs
20
main.rs
|
@ -1,11 +1,17 @@
|
|||
use rand::Rng;
|
||||
fn main() {
|
||||
println!("Guess the number!");
|
||||
|
||||
println!("Please input your guess.");
|
||||
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: i32 = rand::thread_rng().gen_range(1..=3);
|
||||
let mut guess = String::new();
|
||||
if guess == secretnumber {
|
||||
println!("Tot");
|
||||
};
|
||||
if guess > 3 {
|
||||
println!("Die Tür gibt es nicht");
|
||||
}; else if guess = secretnumber{
|
||||
println!("Du bist tot")
|
||||
false
|
||||
}
|
||||
|
||||
|
||||
}
|
Loading…
Reference in a new issue