Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Today we went over more of the Guessing Game. Remember, there are two goals (mostly) that we want to accomplish:
- 1. Create a 'target', or a random number that the user has to guess. (1-100)
- 2. Ask the user for their guess
- 3. Tell the user feedback on their guess, was it too high? too low? correct?
- 4. If the do get it right, remember to use the 'break' keyword to break out of the loop (so you don't keep asking the user for guesses)
- 5. Tell the user how many guesses they have used or have left
- For extra practice, add in a score based off of how close their guess was to the target and the number of guesses it took, and the lower the score, the better it is.
- For example: If the number is 25, and I guess 20, add 5 to my score. Then also add a set 10 amount every time I use a guess, that way more guesses means a higher score, which is not as good.
- For SUPER COOL POINTS!!!
- Save all the scores to a file and read from the file to determine a list of 'high scores'.
- We will go over this^ over the next few weeks.
- Otherwise, we will review all the necessary elements of the code in more depth tomorrow.
- As a reminder, Isabel will be teaching all of you tomorrow instead of me. I will still be willing to help as well, but I will be working with the other group.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement