0% found this document useful (0 votes)
10 views2 pages

Import Os

This document contains code for a text-based adventure game. It defines functions for clearing the screen, pausing, and two puzzles involving safes with coded messages. It also defines an inventory and map of interconnected rooms that can be traveled between.

Uploaded by

nullrabbit5
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views2 pages

Import Os

This document contains code for a text-based adventure game. It defines functions for clearing the screen, pausing, and two puzzles involving safes with coded messages. It also defines an inventory and map of interconnected rooms that can be traveled between.

Uploaded by

nullrabbit5
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

import os

import string

#clear screen
def clear():
os.system('cls')
#

#pause
def brak():
input('--press enter to continue--')
#

#invtory
invitory = []
#

#puzzles
def puzzle1():
print(f"Hello {name}, Ive never seen you around here before but I have heard
great stories about you.")
help = input(f"Here, I have this safe with with message but I dont know what
the code is\nCan you help?\n{'-' * 30}\nYes No\n{'-' * 30}\n")
if (help == 'yes'):
clear()
print("\nThank you so much")
print(f"{'-' * 20}")
print("MESSAGE")
print("\nCan You obseRve the Secets ThAt Lie within me?")
attempt = input("Code: ")
attemp = attempt.lower().sttip()
if (attempt == "cyrstal"):
print("You cracked the code! ")
print('A key has been added to your invitory')
invitory.append('key')
brak()

else:
print('\n...huh, that didnt work')
brak()
elif(help == 'no'):
print("thank you have a nice day ")
brak()
else:
print("Dont be coming in here with all that mumbojumbo!!")
brak()
def puzzle2():
print(f"Hello {name}, Ive never seen you around here before but I have heard
great stories about you.")
help = input(f"Here, I have this safe with with message but I dont know what
the code is\nCan you help?\n{'-' * 30}\nYes No\n{'-' * 30}\n")
help = help.lower().strip()
if (help == 'yes'):
clear()
print("\nThank you so much")
print(f"{'-' * 20}")
print("MESSAGE")
print("\nWhat Always Transformed the Earths Rocky mountains")
attempt = input("Code: ")
attempt = attempt.lower().strip()
if (attempt == "water"):
print("You cracked the code! ")
print('A key has been added to your invitory')
invitory.append('key')
brak()

else:
print('\n...huh, that didnt work')
brak()
elif (help == 'no'):
print("Well thank you for stopping by.")
brak()
else:
print("Dont be coming in here with all that nonsense")
brak()
#

#rooms
rooms = {
'House' : {'South':'outisde'},
'Outside' : {'North':'House', 'East':'Village', 'West': 'Forest'},
'Village' : {'North':'Store1', 'East':'Store2', 'West':'Outside'},
'Store1' : {'South':'Village', 'Clerk1':'Puzzle1'},
'Store2' : {'West':'Village', 'Clerk2':'Puzzle2'},
'Forest' : {'North':'Cave1', 'South':'Cave2', 'West':'Garden'},
'Cave1' : {'South':'Forest'},
'Cave2' : {'East':'Dungeon Gate', 'West': 'Dead End'},
'Dungeon Gate' : {'East':'Boss Room', 'West':'Cave2'},
'Boss Room' : {'West':'Dungeon Gate', 'Boss':'TeenyTiny'},
'Dead End' : {'East':'Cave2', 'Event':'Safe'}
}
#

#track last move


msg =

You might also like