Project
Number guessing game
Build a guessing game step by step: compare guesses, loop until correct, and count the tries.
- The first input line is the secret number and the second is a guess. Print
Too low,Too highorCorrect!. - Now keep asking for guesses in a
whileloop until the guess is correct, printingToo loworToo highafter each wrong guess andCorrect!at the end. - Count the guesses. After
Correct!, printYou needed N guesses(N includes the correct guess).
Line 1, column 1Tab indents 4 spaces. Press Esc then Tab to leave the editor.