src/main.rs gelöscht
because I´m stupid
This commit is contained in:
		
							parent
							
								
									81b69c0fa9
								
							
						
					
					
						commit
						31c4d9f4bc
					
				
							
								
								
									
										25
									
								
								src/main.rs
									
									
									
									
									
								
							
							
						
						
									
										25
									
								
								src/main.rs
									
									
									
									
									
								
							|  | @ -1,25 +0,0 @@ | ||||||
| use std::io; |  | ||||||
| use rand::Rng; |  | ||||||
| fn main(){ |  | ||||||
|     let mut score:u32 = 0; |  | ||||||
|     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 secretnumber = rand::thread_rng().gen_range(1..=3); |  | ||||||
|         let mut guess = String::new(); 
 |  | ||||||
|         let _input= io::stdin() |  | ||||||
|                 .read_line(&mut guess); |  | ||||||
|         println!("Der Geist ist hinter der Tür {}", secretnumber); |  | ||||||
|         let guess: u32 = guess.trim().parse().expect("Please type a number!"); 
 |  | ||||||
|         if guess == secretnumber { |  | ||||||
|             println!("Dein score: {}", score); |  | ||||||
|             panic!("Du bist tot") |  | ||||||
|         } |  | ||||||
|         else  { |  | ||||||
|             println!("Du hast überlebt"); |  | ||||||
|         } |  | ||||||
|          let _score = score += 1; |  | ||||||
|     } |  | ||||||
| } |  | ||||||
		Loading…
	
		Reference in a new issue