Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Fortune Cookie
- # Display one of the five phrases at random
- # josh Karapetian March 28, 2013
- #
- # Program
- #
- # When the user presses enter they gets a random fortune
- import random
- # Psuedocode
- # welcome the player to the game and explain whats about to go down
- # Tell player to press enter to see their fortune
- # Computer picks a random number between 1 and 5
- # if 1
- # Fortune 1
- # elif 2
- # Fortune 2
- # elif 3
- # Fortune 3
- # elif 4
- # Fortune 4
- # elif 5
- # Fortune 5
- # Computer displays fortune
- # Press enter to leave
- # -------------------------------------------------
- # Introduction
- print = "\tWelcome to the Fortune Cookie Program!"
- raw_input("\nPress enter to see what your fortune is!")
- # Values
- f_one = "You will have great fortunes in the near future"
- f_two = "Your close friends will help you along the way"
- f_three = "The future is good for you"
- f_four = "Work hard and you will find treasure that you never imagined"
- f_five = "You are kind and wonderful, hold on to that"
- f_num = random.randrange(5) + 1
- # Program Display
- if (f_num == 1):
- print f_one
- elif (f_num == 2):
- print f_two
- elif (f_num == 3):
- print f_three
- elif (f_num == 4):
- print f_four
- elif (f_num == 5):
- print f_five
- # End
- raw_input("\n\nPress enter to exit program.")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement