Advertisement
Sc2ad

Lecture Notes- 9/12/16

Sep 12th, 2016
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.25 KB | None | 0 0
  1. Today we went over more of the Guessing Game. Remember, there are two goals (mostly) that we want to accomplish:
  2. 1. Create a 'target', or a random number that the user has to guess. (1-100)
  3. 2. Ask the user for their guess
  4. 3. Tell the user feedback on their guess, was it too high? too low? correct?
  5. 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)
  6. 5. Tell the user how many guesses they have used or have left
  7. 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.
  8. 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.
  9. For SUPER COOL POINTS!!!
  10. Save all the scores to a file and read from the file to determine a list of 'high scores'.
  11. We will go over this^ over the next few weeks.
  12.  
  13. Otherwise, we will review all the necessary elements of the code in more depth tomorrow.
  14.  
  15. 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