diff --git a/alternative.py b/alternative.py index 749f143..e29e305 100644 --- a/alternative.py +++ b/alternative.py @@ -5,13 +5,12 @@ is good https://github.coventry.ac.uk/lycette2/CuriosityKilledTheSphinx -choice = input("Enter choice:\nA = []\nB = []\nC = []\n->") - ''' history = [] # empty storage area for choices -def start(): + +def start(): # super unnecessary and can be removed loop = True difficulty = "" @@ -33,7 +32,7 @@ def start(): history.append(difficulty.upper()) -def getAnswer1(question, text): +def getAnswer1(question, text): # function to handle 1 response from the user loop = True choice = "" @@ -52,7 +51,7 @@ def getAnswer1(question, text): history.append(choice.upper()) # adds the choice the user picked -def getAnswer2(question, text): +def getAnswer2(question, text): # function to handle 2 responses from the user loop = True choice = "" @@ -74,7 +73,7 @@ def getAnswer2(question, text): history.append(choice.upper()) # adds the choice the user picked -def getAnswer3(question, text): +def getAnswer3(question, text): # function to handle 3 responses from the user loop = True choice = "" @@ -101,7 +100,7 @@ def getAnswer3(question, text): history.append(choice.upper()) # adds the choice the user picked -def getAnswer4(question, text): +def getAnswer4(question, text): # function to handle 4 responses from the user loop = True choice = "" @@ -143,10 +142,29 @@ text = {"A": "Continue reading the magazine", getAnswer3(question, text) -print(history) # prints the history of choices made by the user +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. You can't read much further because the phone is still ringing. Loudly. " + 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) + 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) \ No newline at end of file diff --git a/main.py b/main.py index 59d536c..6da59ad 100644 --- a/main.py +++ b/main.py @@ -3,10 +3,13 @@ sphinx story is good +https://github.coventry.ac.uk/lycette2/CuriosityKilledTheSphinx + choice = input("Enter choice:\nA = []\nB = []\nC = []\n->") ''' +history = [] def start(): loop = True @@ -26,6 +29,8 @@ def start(): else: print("Please enter a valid option.") + history.append(difficulty.upper()) + # Main block start() @@ -50,3 +55,7 @@ while loop == True: loop = False else: print("Please enter a valid option.") + +history.append(choice) + +print(history)