This week only. Pastebin PRO Accounts Christmas Special! Don't miss out!Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Apr 4th, 2013  |  syntax: None  |  size: 1.34 KB  |  views: 71  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. # Fortune Cookie
  2. # Display one of the five phrases at random
  3. # josh Karapetian March 28, 2013
  4. #
  5. # Program
  6. #
  7. # When the user presses enter they gets a random fortune
  8.  
  9. import random
  10.  
  11. # Psuedocode
  12.  
  13. # welcome the player to the game and explain whats about to go down
  14. # Tell player to press enter to see their fortune
  15. # Computer picks a random number between 1 and 5
  16. #   if 1
  17. #       Fortune 1
  18. #   elif 2
  19. #       Fortune 2
  20. #   elif 3
  21. #       Fortune 3
  22. #   elif 4
  23. #       Fortune 4
  24. #   elif 5
  25. #       Fortune 5
  26. # Computer displays fortune
  27. # Press enter to leave
  28.  
  29. # -------------------------------------------------
  30. # Introduction
  31. print = "\tWelcome to the Fortune Cookie Program!"
  32. raw_input("\nPress enter to see what your fortune is!")
  33.  
  34. # Values
  35. f_one = "You will have great fortunes in the near future"
  36. f_two = "Your close friends will help you along the way"
  37. f_three = "The future is good for you"
  38. f_four = "Work hard and you will find treasure that you never imagined"
  39. f_five = "You are kind and wonderful, hold on to that"
  40.  
  41. f_num = random.randrange(5) + 1
  42.  
  43. # Program Display
  44. if (f_num == 1):
  45.     print f_one
  46. elif (f_num == 2):
  47.     print f_two
  48. elif (f_num == 3):
  49.     print f_three
  50. elif (f_num == 4):
  51.     print f_four
  52. elif (f_num == 5):
  53.     print f_five
  54.  
  55.  
  56.  
  57. # End
  58. raw_input("\n\nPress enter to exit program.")
clone this paste RAW Paste Data