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;
|
use rand::Rng;
|
||||||
fn main() {
|
loop {
|
||||||
println!("Guess the number!");
|
println!("Vor dir sind drei Türen");
|
||||||
|
println!("Eine von ihnen tötet dich ");
|
||||||
println!("Please input your guess.");
|
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 secretnumber: i32 = rand::thread_rng().gen_range(1..=3);
|
||||||
let mut guess = String::new();
|
let mut guess = String::new();
|
||||||
if guess == secretnumber {
|
if guess > 3 {
|
||||||
println!("Tot");
|
println!("Die Tür gibt es nicht");
|
||||||
};
|
}; else if guess = secretnumber{
|
||||||
|
println!("Du bist tot")
|
||||||
|
false
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
Loading…
Reference in a new issue