Guess the Number
Simulate a number guessing game! The secret number is 7. Start guessing at 1 and keep going up by 1 until you find it. Print each guess, then print how many guesses it took.
Expected output:
text
Guessing 1... Guessing 2... Guessing 3... Guessing 4... Guessing 5... Guessing 6... Guessing 7... Found it in 7 guesses!
Hints:
- Use a
loopwithbreakor awhileloop - Keep a counter for the current guess
- When the guess equals 7, print the final message and stop
rust
fn main() {
}