Skip to content
Permalink
147286a417
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
170 lines (136 sloc) 5.8 KB
'''
sphinx story
is good
https://github.coventry.ac.uk/lycette2/CuriosityKilledTheSphinx
'''
history = [] # empty storage area for choices
def start(): # super unnecessary and can be removed
loop = True
difficulty = ""
while loop == True:
difficulty = input("Enter Difficulty:\nA = EASY\nB = MEDIUM\nC = HARD\n->")
if difficulty == "a" or difficulty == "A":
print("You have selected EASY")
loop = False
elif difficulty == "b" or difficulty == "B":
print("You have selected MEDIUM")
loop = False
elif difficulty == "c" or difficulty == "C":
print("You have selected HARD")
loop = False
else:
print("Please enter a valid option.")
history.append(difficulty.upper())
def getAnswer1(question, text): # function to handle 1 response from the user
loop = True
choice = ""
while loop == True:
print(question)
choice = input("Enter choice:"
"\nA = " + text["A"] +
"\n->")
if choice == "a" or choice == "A":
print("You have selected A: " + text[choice.upper()])
loop = False
else:
print("Please enter a valid option.") # runs if the answer is not valid
history.append(choice.upper()) # adds the choice the user picked
def getAnswer2(question, text): # function to handle 2 responses from the user
loop = True
choice = ""
while loop == True:
print(question)
choice = input("Enter choice:"
"\nA = " + text["A"] +
"\nB = " + text["B"] +
"\n->")
if choice == "a" or choice == "A":
print("You have selected A: " + text[choice.upper()])
loop = False
elif choice == "b" or choice == "B":
print("You have selected B: " + text[choice.upper()])
loop = False
else:
print("Please enter a valid option.") # runs if the answer is not valid
history.append(choice.upper()) # adds the choice the user picked
def getAnswer3(question, text): # function to handle 3 responses from the user
loop = True
choice = ""
while loop == True:
print(question)
choice = input("Enter choice:"
"\nA = " + text["A"] +
"\nB = " + text["B"] +
"\nC = " + text["C"] +
"\n->")
if choice == "a" or choice == "A":
print("You have selected A: " + text[choice.upper()])
loop = False
elif choice == "b" or choice == "B":
print("You have selected B: " + text[choice.upper()])
loop = False
elif choice == "c" or choice == "C":
print("You have selected C: " + text[choice.upper()])
loop = False
else:
print("Please enter a valid option.") # runs if the answer is not valid
history.append(choice.upper()) # adds the choice the user picked
def getAnswer4(question, text): # function to handle 4 responses from the user
loop = True
choice = ""
while loop == True:
print(question)
choice = input("Enter choice:"
"\nA = " + text["A"] +
"\nB = " + text["B"] +
"\nC = " + text["C"] +
"\nC = " + text["D"] +
"\n->")
if choice == "a" or choice == "A":
print("You have selected A: " + text[choice.upper()])
loop = False
elif choice == "b" or choice == "B":
print("You have selected B: " + text[choice.upper()])
loop = False
elif choice == "c" or choice == "C":
print("You have selected C: " + text[choice.upper()])
loop = False
elif choice == "d" or choice == "D":
print("You have selected D: " + text[choice.upper()])
loop = False
else:
print("Please enter a valid option.") # runs if the answer is not valid
history.append(choice.upper()) # adds the choice the user picked
# Main block
start()
question = "You are reading a magazine. The phone rings."
text = {"A": "Continue reading the magazine",
"B": "Inspect the room",
"C": "You pick up the phone"
}
getAnswer3(question, text)
print(history) # prints the history of choices made by the user, not really needed.
if history[1] == "A":
question = "You continue Archaeologist's Digest and read about how there's been a new discovery in Giza. How interesting.\nYou can't read much further because the phone is still ringing. Loudly. "
text = {"A": "Answer"}
getAnswer1(question, text)
print(history)
elif history[1] == "B":
question = "You're in your office. Large shelves are stacked from end to end.From ancient Latin and Hebrew to Greek and Hieroglyphics.\nPictures from previous expeditions are framed on the wall."
text = {"A": "Inspect images",
"B": "Inspect books",
"C": "Back to the magazine"
}
getAnswer3(question, text)
print(history)
if history[2] == "C":
pass # some sort of way to get back to the phone? do we store the data somewhere else? gg python i am confused
elif history[1] == "C":
question = "Ethan Stewart speaking, an interesting and rather weird door has been dug up.\nNo amount of force has worked on the door and I thought I'd contact you as the leading expert in hieroglyphs.\nI want you to fly over to Giza immediately and inspect the door."
text = {"A": "…",
"B": "Is it urgent? And who are you anyway?",
"C": "Don’t tell me what to do!",
"D": "I’ll be on my way."
}
getAnswer4(question, text)
print(history)