Skip to content

Instantly share code, notes, and snippets.

@Joshbeyer
Created August 3, 2021 08:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Joshbeyer/719025f98753e862fb3b29a820f013bb to your computer and use it in GitHub Desktop.
Save Joshbeyer/719025f98753e862fb3b29a820f013bb to your computer and use it in GitHub Desktop.
testing out python with a simple game
import os #For keeping console clean
os.system('cls') #Windows
os.system('clear') #Linux
#clearing console function
def clear_():
os.system('cls') #Windows
os.system('clear') #linux
print('''
*******************************************************************************
| | | |
_________|________________.=""_;=.______________|_____________________|_______
| | ,-"_,="" `"=.| |
|___________________|__"=._o`"-._ `"=.______________|___________________
| `"=._o`"=._ _`"=._ |
_________|_____________________:=._o "=._."_.-="'"=.__________________|_______
| | __.--" , ; `"=._o." ,-"""-._ ". |
|___________________|_._" ,. .` ` `` , `"-._"-._ ". '__|___________________
| |o`"=._` , "` `; .". , "-._"-._; ; |
_________|___________| ;`-.o`"=._; ." ` '`."\` . "-._ /_______________|_______
| | |o; `"-.o`"=._`` '` " ,__.--o; |
|___________________|_| ; (#) `-.o `"=.`_.--"_o.-; ;___|___________________
____/______/______/___|o;._ " `".o|o_.--" ;o;____/______/______/____
/______/______/______/_"=._o--._ ; | ; ; ;/______/______/______/_
____/______/______/______/__"=._o--._ ;o|o; _._;o;____/______/______/____
/______/______/______/______/____"=._o._; | ;_.--"o.--"_/______/______/______/_
____/______/______/______/______/_____"=.o|o_.--""___/______/______/______/____
/______/______/______/______/______/______/______/______/______/______/_____ /
*******************************************************************************
''')
print("Welcome to Treasure Island.")
print("Your mission is to find the treasure.")
print("After each question, reply with the associated number for the answer you wish to use.")
if(input("Would you like to begin? 1: Yes, 2: No\n") ==
"1"):
clear_()
print('''
You wake up lost in the woods, with no memory of how you got there. \nThere is a somewhat clear path in front of you. After following it, \nyou come to a crossroad, which path do you take?\n
''')
if(input("1: Take the left path, 2: Take the right path.\n") == "2"):
print("After taking the path leading right, you trip on a rock and snap your neck." )
print("Game Over.")
else:
clear_()
print('''
You follow the path leading left. Shortly after, you see what appears to be a cabin up a head. \n ''')
if(input("1: Investigate the cabin. 2: Keep going, there's probably some creepy guy living there.\n") == "1"):
print("Yep, there was indeed a creepy guy living there. And he murdered you in the face with a hammer.")
print("GAME OVER.")
else:
clear_()
print('''
After passing the cabin, you find a river infront of you.
''')
if(input("1: Play it safe, wait for a passing boat, 2: Be a man, swim across\n") == "1"):
clear_()
print('''
After waiting about 30 minutes, a kind man passing by in his boat stops, asking if you would like a ride.
''')
if(input("1: Accept the mans offer, 2: Refuse, I don't need your help old man!\n") == "2"):
clear_()
print('''
The man yells at you, "Why are you standing on the side of the river with your tumb out if you don\'t want a ride?" He shoots you in the face and then proceeds to speed off while mumbing, "Damn kids *mumble mumble* millennials *mumble mumble* bob saget *mumble mumble*"
''')
print("GAME OVER")
else:
clear_()
print('''
You accept the offer, and get aboard his boat. Once there, he asks if you need to go across, or down the river.
''')
if(input("1: I want to go across the river, 2: I want to go down the river\n") == "2"):
clear_()
print('''
The man agree\'s to take you down river. However, after some time passes during the journey, the man get hungry. You turn out to be on the menu.
''')
print("GAME OVER.")
else:
clear_()
print('''
The man agree\'s to take you across the river.
''')
print("You reach the other side, and get off the boat.")
print("As you walk inland, you hear crying from the bushes. Sounds like a child.")
if(input("1: Investigate the crying, 2: Pretend you don\'t hear anything.\n") == "2"):
clear_()
print('''
You ignore the crying, and as you walk away, the crying turns into violent screaming. Something terrible is happening, but you just nervously whistle as if you don't hear anything. Carrying on about your way.
''')
print('''
After you have traveled for some time, the screaming came to an abrupt stop. You now see a cave. ''')
if(input("1: Go in the cave, 2: Hell no, I seen the decent movie\n") == "2"):
clear_()
print("You run away from the cave. As you are running a nearby bear takes notice, and see\'s you as an easy meal.")
print("You were mauled to death by a bear.")
print("GAME OVER.")
else:
clear_()
print('''
You walk into the cave, following the path. You trip on a rock, hitting your head. You wake up, realizing that you were out in the woods and chose to take the right path, tripping and hitting your head.
''')
print('''
¯\_( ͡❛ ͜ʖ ͡❛)_/¯ \n
What did you expect.
''')
else:
clear_()
print('''
You peek into the bush looking for the source of the crying.
Once you can see inside, you realize its a tape recording. It was a trap, meanwhile the actual child comes up from behind and stabs you to death.
''')
print("GAME OVER.")
else:
clear_()
print('''You try to swim across, but soon after leaving the shore you are a passing boat runs you over, slicing you to peices.
''')
print("GAME OVER.")
else:
print("Exiting Game")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment