Skip to content

Instantly share code, notes, and snippets.

@gnilchee
Last active August 29, 2015 14:15
Show Gist options
  • Save gnilchee/3c6d3a80d060098a2205 to your computer and use it in GitHub Desktop.
Save gnilchee/3c6d3a80d060098a2205 to your computer and use it in GitHub Desktop.
Kinda like Last of Us, but really just playing with functions
#!/usr/bin/env python2
import time
def joel_or_ellie():
char = raw_input("(J)oel or (E)llie? ").lower()
if char == "joel" or char == "j":
joel_weapons()
elif char == "ellie" or char == "e":
ellie_weapons()
else:
print "Choice not found... Try again."
joel_or_ellie()
def joel_weapons():
print "Here comes a clicker!!!"
choice = raw_input("(B)ow, (S)hotgun, or S(h)iv? ").lower()
if choice == "bow" or choice == "b":
print "2 quick pulls and the clicker is dead, good choice!"
time.sleep(2)
play_again()
elif choice == "shotgun" or choice == "s":
print "Only 1 shot left and you used it to blow its head off, gross!"
time.sleep(2)
play_again()
elif choice == "shiv" or choice == "h":
print "You forgot to make one! DEAD!!!"
time.sleep(2)
play_again()
else:
print "Whoops! Typical PS glitch, Restart!"
joel_weapons()
def ellie_weapons():
print "Here comes that PEDO perv!!!"
choice = raw_input("(B)ow, (H)andgun, or (K)nife? ").lower()
if choice == "bow" or choice == "b":
print "1 carefully aimed pull and that PEDO will never reproduce again plus it allowed you to escape, good choice!"
time.sleep(3)
play_again()
elif choice == "handgun" or choice == "h":
print "Only 2 shots left and you made them both headshots, NICE TRY PEDO!"
time.sleep(2)
play_again()
elif choice == "knife" or choice == "k":
print "No good, his neck is bleeding but it did not stop him! Ellie has DIED!"
time.sleep(2)
play_again()
else:
print "Whoops! Typical PS glitch, Restart!"
ellie_weapons()
def play_again():
print "Would you like to play again?"
play = raw_input("(Y)es or (N)o: ").lower()
if play == "yes" or play == "y":
joel_or_ellie()
elif play == "no" or play == "n":
raise SystemExit
else:
print "Input not understood."
play_again()
joel_or_ellie()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment