From 0b5baef75167754caca9aeddba65087426b93af1 Mon Sep 17 00:00:00 2001 From: suzan Date: Tue, 24 Jan 2023 19:28:45 +0300 Subject: [PATCH] the improved graduation plan --- states.py | 74 +++++++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 58 insertions(+), 16 deletions(-) diff --git a/states.py b/states.py index 5efca8b..e5848b7 100644 --- a/states.py +++ b/states.py @@ -1,65 +1,107 @@ +import os , time , random + currentRoom = "aquarium" start = True graduation = False study = 0 +items = { + "aquarium": ["breadcube", "knife", "computer", "keyboard", "dragon", "candles", "meansofproduction"], + "neutralzone": ["students", "artworks", "offices", "sandwitches"], + "office": ["ideology", "propoganda", "pencilsharpener", "paint", "money"] +} + +inventory = [] + +#seperating the text and printing in delay +def printer (text): + for t in text: + print(t, end = "", flush= True) + time.sleep(random.choice([0.01, 0.05, 0.1, 0.03, 0.02])) + print() + +def taker(room): + if any(x in spliti for x in ["get", "grab", "take", "carry", "steal"]): + for item in items[room]: + if item in spliti: + printer("You took " + item) + inventory.append(item) + items[room].remove(item) while True: if (start == True): - print("Graduation: The Game") + printer("Graduation: The Game") start = False if (graduation == True): - print("You Win!") + printer("You Win!") exit() i = input() + os.system("cls") + spliti = i.split(" ") +#inventory + if "inventory" in i: + printer("In you current inventory is " + ", ".join(inventory)) # Choices in the aquarium if currentRoom == "aquarium": if i in ["look","see","view","explore"]: - print("Oh I'm in an aquarium cool") + printer("Oh I'm in an aquarium cool") + printer("Oh look in the room! There is " + ", ".join(items["aquarium"])) + #finds the verb + elif i in ["exit","walk","run","door","leave"]: - print("You use the door to exit the aquarium") + printer("You use the door to exit the aquarium") currentRoom = "neutralzone" elif i in ["learn","study","read", "pain", "frustration", "fun"]: - print("You have studied really hard. Noice") + printer("You have studied really hard. Noice") study = study + 30 - print("your ECTS is " + str(study) + " points") + printer("your ECTS is " + str(study) + " points") + + else: + taker("aquarium") + # Choices in the neutral zone elif currentRoom == "neutralzone": if i in ["look","see","view","explore"]: - print("Oh the BA students have a presentation. annoying.") + printer("Oh the BA students have a presentation. annoying.") + printer("Oh look in the room! There is " + ", ".join(items["neutralzone"])) elif i in ["exit","walk","run","door","leave"]: - print("You use the door to exit the neutralzone") + printer("You use the door to exit the neutralzone") i = input("which door? (1 or 2)") if i == "1": - print("You use the door to the aquarium") + printer("You use the door to the aquarium") currentRoom = "aquarium" elif i == "2": - print("You use the door to the office") + printer("You use the door to the office") currentRoom = "office" + else: + taker("neutralzone") # Choices in the office elif currentRoom == "office": if i in ["look","see","view","explore"]: - print("Oh I'm in an office, look theres Leslie. cool.") + printer("Oh I'm in an office, look theres Leslie. cool.") + printer("Oh look in the room! There is " + ", ".join(items["office"])) elif i in ["exit","walk","run","door","leave"]: - print("You use the door to exit the office. Bye Leslie!") + printer("You use the door to exit the office. Bye Leslie!") currentRoom = "neutralzone" elif i in ["talk","discuss","debate","ask","say"]: - print("Hiiiiii Leslie!") - print("Leslie: Hiiiiiii student, how can I help you?") + printer("Hiiiiii Leslie!") + printer("Leslie: Hiiiiiii student, how can I help you?") i = input() if i in ["graduate","finish","degree"]: if study >= 119: - print("no problem, here is your final degree. congratulations!") + printer("no problem, here is your final degree. congratulations!") graduation = True else: - print("No way you only have " + str(study) + " ECTS points. go to the aquarium and study") \ No newline at end of file + printer("No way you only have " + str(study) + " ECTS points. go to the aquarium and study") + else: + taker("office") \ No newline at end of file