Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from sys import exit
- from ext_links import *
- from game_messages import *
- init_hscore = 100
- final_score = 0
- # Beginning. Proceed or quit game.
- def start():
- print "Your shopping habits will either help you live longer or they will help you die sooner. No kidding! Wanna find out which one of the two in your case?", yn
- find_out = raw_input(select).upper()
- if find_out == "YES":
- print "\nGreat! Let's go shopping... but first..."
- print "Think of this as a personal health deposit account at the Health Bank..."
- print "Your starting Health Score is: %d" % init_hscore
- print "So, here is the situation..."
- inner_outer()
- else:
- out("No prob. May be next time.")
- # Choose shopping from inner or outer isles
- def inner_outer():
- print "You enter the grocery store. You have to choose between the 'inner' or 'outer' isles. Which isles do you choose?"
- init_isle = raw_input(select).lower()
- if init_isle == "inner":
- inner()
- elif init_isle == "outer":
- outer()
- else:
- print not_sure
- inner_outer()
- # Define inner isles and the four subcategories.
- def inner():
- print "Okay. You are about to do some shopping from the inner isles of the store!"
- print "There are four main sections. Choose which section you want to go to first."
- print "Your choices are: \n\n\t cereal \n\t snacks and chips \n\t peanut butter \n\t sports drinks\n"
- inner_choice = raw_input(select).lower()
- if inner_choice == "cereal":
- new_hscore = init_hscore - 5
- print "NOTE: Shopping from the 'cereal' isle is not a good idea. \nYou just lost 5 points from your Health Score. \nYour new Health Score is %d!" % new_hscore
- print cereal_url
- again()
- elif inner_choice == "snacks and chips":
- new_hscore = init_hscore - 5
- print "NOTE: Shopping from the 'snacks and chips' isle is not a good idea. \nYou just lost 5 points from your Health Score. \nYour new Health Score is %d!" % new_hscore
- print snack_url
- again()
- elif inner_choice == "peanut butter":
- new_hscore = init_hscore - 5
- print "NOTE: Shopping from the 'peanut butter' isle is not a good idea. \nYou just lost 5 points from your Health Score. \nYour new Health Score is %d!" % new_hscore
- print peanut_url
- again()
- elif inner_choice == "sports drinks":
- new_hscore = init_hscore - 5
- print "NOTE: Shopping from the 'sports drinks' isle is not a good idea. \nYou just lost 5 points from your Health Score. \nYour new Health Score is %d!" % new_hscore
- print gatorade_url
- again()
- else:
- print not_sure
- inner()
- # Define outer isles and the three subcategories.
- def outer():
- print "You are about to shop from the outer isles of the store!"
- print "There are three main sections. Choose which section you want \nto go to first."
- print "Your choices are: \n\n\t produce \n\t dairy \n\t meat \n"
- outer_choice = raw_input(select).lower()
- if outer_choice == "produce":
- new_hscore = init_hscore + 5
- print "Awesome! Shopping from the 'produce' isle is a great idea. \nYou just added 5 points to your Health Score. \nYour new Health Score is %d!" % new_hscore
- print poduce_url
- again()
- elif outer_choice == "dairy":
- new_hscore = init_hscore + 2
- print "Alright. Shopping from the 'dairy' isle is a good idea. \nYou just added 2 points to your Health Score. \nYour new Health Score is %d!" % new_hscore
- print dairy_url
- again()
- elif outer_choice == "meat":
- new_hscore = init_hscore + 2
- print "Not bad! Shopping from the 'meat' isle could be a good idea. \nYou just added 2 points to your Health Score. \nYour new Health Score is %d!" % new_hscore
- print meat_url
- again()
- else:
- print not_sure
- outer()
- # Define a function for quitting the game
- def out(why):
- print why, "Your final Health Score is: %d" % final_score
- print "Good bye!"
- exit(0)
- # Define a function for going back to choosing from inner or outer isles 'inner_outer()'
- def again():
- print "Want to continue shopping?", yn
- go_again = raw_input(select).upper()
- if go_again == "YES":
- inner_outer()
- else:
- out("No prob.")
- # Initiate the game
- start()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement