Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Apr 4th, 2013  |  syntax: Python  |  size: 1.28 KB  |  views: 52  |  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. # welcome the player to the game and explain whats about to go down
  13. # Tell player to press enter to see their fortune
  14. # Computer picks a random number between 1 and 5
  15. # if 1
  16. #       Fortune 1
  17. # elif 2
  18. #       Fortune 2
  19. # elif 3
  20. #       Fortune 3
  21. # elif 4
  22. #       Fortune 4
  23. # elif 5
  24. #       Fortune 5
  25. # Computer displays fortune
  26. # Press enter to leave
  27. # -------------------------------------------------
  28. # Introduction
  29.  
  30. print = "\tWelcome to the Fortune Cookie Program!"
  31. raw_input("\nPress enter to see what your fortune is!")
  32.  
  33. # Values
  34.  
  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. # End
  56. raw_input("\n\nPress enter to exit program.")