0
[SOLVED] Print something when second loop occured
println!("guess number between 1 - 20"); println!("Please input your guess"); loop { println!("Try again.."); let mut user_guessed = String::new(); io::stdin() .read_line(&mut user_guessed) .expect("your input guessed wasn't a valid number!"); let user_guessed: u32 = match user_guessed.trim().parse() { Ok(u32) => u32, Err(_) => { println!("Please enter a number!"); continue; }, }; I want the first time this code is run don't print "Try again.." and when it's loop for second time or more and then print that "try again..", How to do that?.
4 Réponses
0
whats the error?
0
No error actually
0
I just want the first time code run don't print "try again.."
0
Already solved it