#libraries import time import random #variables global userroom global keyroom global keypos global userpos global userinv global roomchosen global drachp global giveup #functions def setup() : global userroom global keyroom global keypos global userpos global userinv global roomchosen global drachp global giveup setup( ) def checkroom() : global userroom global keyroom global keypos global userpos global userinv global roomchosen global drachp global giveup userroom = ["Hall", "Foyer", "Art gallery", "Dining Hall", "Great Hall", "Bedroom", "Library", "Cellar", "Kitchen", "Garden"] keyroom = ["Hall", "Foyer", "Art gallery", "Dining Hall", "Great Hall", "Bedroom", "Library", "Cellar", "Kitchen", "Garden"] random.shuffle(keyroom) keypos = keyroom[0] userpos = userroom[0] userinv = ["Sword", ] roomchosen = 1 drachp = 150 if userpos == "Hall" : while True: roomchosen = str(input("You enter the dark castle, coated in darkness and webs. One door reveals the next room. Would you like to enter the Foyer? (y/n)")) if roomchosen == "y" : print("You enter the foyer, sealing yourself in the building.") break elif roomchosen == "n": print("You decide to leave the castle before it's too late, entering the dark forest to never return.") giveup = 1 if userpos == "Foyer" : print("You make your way to the foyer, 4 doors reveal the next rooms. Where will you go?") #intro print("You enter a dark castle, riddled with webs and creatures") print("Your task? Find the Master Key and open the Cellar where Dracula awaits in his crypt") print("Where will you go first?") #game while drachp != 0 : setup()