import os , time , random # Setting up the current (saved) state 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 so the content on the screen is readable and easy to comprehend 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() # Defining the "taker" function and setting it up in each of the three rooms below 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) # Creating the while-loop while True: if (start == True): printer("Graduation: The Game") start = False if (graduation == True): printer("You Win!") exit() # Clearing the screen: "cls" for Windows; "clear" for macOS i = input() os.system("cls") spliti = i.split(" ") # Creating an 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"])) elif i in ["exit","walk","run","door","leave"]: printer("You use the door to exit the aquarium") currentRoom = "neutralzone" # The ECTS condition, or the point-gaining system. Every "study" adds 30 points to the player's score. The goal is to reach 120 points or credits. 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" # The graduation condition, if ECTS points >= 119 --> Epic Win! If <119 --> Go study. 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")