Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 1

Number Guesser

Explore

Task Requirements

I am required to:

 Create a number guessing game.


 Create a function to get user input.
 There should be correct symbol for greater than or less than the secret number.
 Give the user 7 attempts to get the correct answer.
 If user did not guess correctly give them a incorrect sequence and display hidden number.
 Give option to replay a new game.

Develop Phase:

Algorithm

1. Import random library.


2. Generate a random no.
3. User greeting (explain game)
4. User input
5. Check user input against the random no.
6. Determine greater or less than or equal to.
7. Output appropriate message to user.
8. Add 1 to number of total guesses.
9. Check total guesses is not greater than 7.
10. If answer is correct end program
11. If it is not correct than give 7 chances.
12. After that give the hidden no. with incorrect sequence.
13. Give option to replay a new game.

You might also like