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): printer("Graduation: The Game") start = False if (graduation == True): 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"]: 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"]: printer("You use the door to exit the aquarium") currentRoom = "neutralzone" elif i in ["learn","study","read", "pain", "frustration", "fun"]: printer("You have studied really hard. Noice") study = study + 30 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"]: 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"]: printer("You use the door to exit the neutralzone") i = input("which door? (1 or 2)") if i == "1": printer("You use the door to the aquarium") currentRoom = "aquarium" elif i == "2": 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"]: 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"]: printer("You use the door to exit the office. Bye Leslie!") currentRoom = "neutralzone" elif i in ["talk","discuss","debate","ask","say"]: printer("Hiiiiii Leslie!") printer("Leslie: Hiiiiiii student, how can I help you?") i = input() if i in ["graduate","finish","degree"]: if study >= 119: printer("no problem, here is your final degree. congratulations!") graduation = True else: printer("No way you only have " + str(study) + " ECTS points. go to the aquarium and study") else: taker("office")