#Storymaker.py - Created by Mr E Ryan 14/05/2026
#Adapt this template to create an interactive story.

#Beginners can edit the responses...
#Intermediate can add additional options and responses
#Experts can add new rooms

#This program includes conditional loops (while), conditional statements (if/elif/else), functions, input, output, Booleans, Strings

def hallway():
    flag = True
    while flag==True:
        print("")
        print("**You are in the downstairs hallway**")
        print("You can see 4 doors (d1,d2,d3,d4) and a (s)taircase")
        choice = input("Where would you like to go to? ")
        if choice.lower() == "d1":
            flag=False
            door1()
        elif choice.lower() == "d2":
            flag=False
            door2()
        elif choice.lower() == "d3":
            flag=False
            door3()
        elif choice.lower() == "d4":
            flag=False
            door4()
        elif choice.lower() == "s":
            flag=False
            staircase("u")
        else:
            print("Your choice wasn't recognised. Please try again.")

def door1():
    print("")
    print("**You have opened Door 1**")
    print("Room 1: This room looks like an office")
    flag = True
    while flag==True:
        print("")
        print("** You are in Room 1 **")
        choice=input("You can see... \na (F)ireplace, \na D(e)sk, \na (A)rmchair, \na (B)ookcase, \na (D)oor. \nWhere would you like to go to? ")
        if choice.lower() == "f":
            print("At the fireplace you see... <edit this response>") #beginner: edit this response
        elif choice.lower() == "e":
            print("At the desk you see... <edit this response>") #beginner: edit this response
        elif choice.lower() == "a":
            print("At the armchair you see... <edit this response>") #beginner: edit this response
        elif choice.lower() == "b":
            print("At the bookcase you see... <edit this response>") #beginner: edit this response
        elif choice.lower() == "d":
            print("You are leaving Room 1")
            flag=False
            hallway()
        else:
            print("Your choice wasn't recognised. Please try again.")

def door2():
    print("")
    print("**You have opened Door 2**")
    print("Room 2: This room looks like a kitchen")
    flag = True
    while flag==True:
        print("")
        print("** You are in Room 2 **")
        choice=input("You can see... \nan(O)ven, \na (T)able, \na (C)upboard, \na (P)antry, \na (D)oor. \nWhere would you like to go to? ")
        if choice.lower() == "o":
            print("At the oven you see... <edit this response>") #beginner: edit this response
        elif choice.lower() == "t":
            print("At the table you see... <edit this response>") #beginner: edit this response
        elif choice.lower() == "c":
            print("At the cupboard you see... <edit this response>") #beginner: edit this response
        elif choice.lower() == "p":
            print("At the pantry you see... <edit this response>") #beginner: edit this response
        elif choice.lower() == "d":
            print("You are leaving Room 2")
            flag=False
            hallway()
        else:
            print("Your choice wasn't recognised. Please try again.")

def door3():
    print("")
    print("**You have opened Door 3**")
    print("Room 3: This room looks like a living room")
    flag = True
    while flag==True:
        print("")
        print("** You are in Room 3 **")
        choice=input("You can see... \na(F)ireplace, \nan(A)rmchair, \na (S)ofa, \na (T)able, \na (D)oor. \nWhere would you like to go to? ")
        if choice.lower() == "f":
            print("At the fireplace you see... <edit this response>") #beginner: edit this response
        elif choice.lower() == "a":
            print("At the armchair you see... <edit this response>") #beginner: edit this response
        elif choice.lower() == "s":
            print("At the sofa you see... <edit this response>") #beginner: edit this response
        elif choice.lower() == "t":
            print("At the table you see... <edit this response>") #beginner: edit this response
        elif choice.lower() == "d":
            print("You are leaving Room 3")
            flag=False
            hallway()
        else:
            print("Your choice wasn't recognised. Please try again.")

def door4():
    print("")
    print("**You have opened Door 4**")
    print("Room 4: This room looks like a Games Room")
    flag = True
    while flag==True:
        print("")
        print("** You are in Room 1 **")
        choice=input("You can see... a \n(F)ireplace, a Billiards \n(T)able, \n(P)ainting, \n(S)culpture, \na (D)oor. \nWhere would you like to go to? ")
        if choice.lower() == "f":
            print("At the fireplace you see... <edit this response>") #beginner: edit this response
        elif choice.lower() == "t":
            print("At the table you see... <edit this response>") #beginner: edit this response
        elif choice.lower() == "p":
            print("At the painting you see... <edit this response>") #beginner: edit this response
        elif choice.lower() == "s":
            print("At the sculpture you see... <edit this response>") #beginner: edit this response
        elif choice.lower() == "d":
            print("You are leaving Room 4")
            flag=False
            hallway()
        else:
            print("Your choice wasn't recognised. Please try again.")

def staircase(choice):
    print("")
    if choice.lower()=="u":
        print("You walk from the hallway and up the staircase.")
        landing()
    elif choice.lower()=="d":
        print("You walk from the landing and down the staircase.")
        hallway()

def landing():
    print("")
    flag = True
    while flag==True:
        print("")
        print("**You are on the upstairs landing**")
        print("You can see 4 doors (d5,d6,d7,d8) and a (s)taircase")
        choice = input("Where would you like to go to? ")
        if choice.lower() == "d5":
            flag=False
            door5()
        elif choice.lower() == "d6":
            flag=False
            door6()
        elif choice.lower() == "d7":
            flag=False
            door7()
        elif choice.lower() == "d8":
            flag=False
            door8()
        elif choice.lower() == "s":
            flag=False
            staircase("d")
        else:
            print("Your choice wasn't recognised. Please try again.")

def door5():
    print("")
    print("**You have opened Door 5**")
    print("Room 5: This room looks like Bedroom")
    flag = True
    while flag==True:
        print("")
        print("** You are in Room 5 **")
        choice=input("You can see... \na (W)ardrobe, \na (C)hest of drawers, \na (B)ed, \na Bedside (T)able \na (D)oor. \nWhere would you like to go to? ")
        if choice.lower() == "w":
            print("At the Wardrobe you see... <edit this response>") #beginner: edit this response
        elif choice.lower() == "c":
            print("At the Chest of Drawers you see... <edit this response>") #beginner: edit this response
        elif choice.lower() == "b":
            print("At the Bed you see... <edit this response>") #beginner: edit this response
        elif choice.lower() == "t":
            print("At the Bedside Table you see... <edit this response>") #beginner: edit this response
        elif choice.lower() == "d":
            print("You are leaving Room 5")
            flag=False
            landing()
        else:
            print("Your choice wasn't recognised. Please try again.")

def door6():
    print("")
    print("**You have opened Door 6**")
    print("Room 6: This room looks like a Master Bedroom")
    flag = True
    while flag==True:
        print("")
        print("** You are in Room 6 **")
        choice=input("You can see... \na (W)ardrobe, \na (C)hest of drawers, \na (B)ed, \na Bedside (T)able \na (D)oor. \nWhere would you like to go to? ")
        if choice.lower() == "w":
            print("At the Wardrobe you hear something inside. You open the door and see a man. ")
            peter()
        elif choice.lower() == "c":
            print("At the Chest of Drawers you see... <edit this response>") #beginner: edit this response
        elif choice.lower() == "b":
            print("At the Bed you see... <edit this response>") #beginner: edit this response
        elif choice.lower() == "t":
            print("At the Bedside Table you see... <edit this response>") #beginner: edit this response
        elif choice.lower() == "d":
            print("You are leaving Room 5")
            flag=False
            landing()
        else:
            print("Your choice wasn't recognised. Please try again.")

def door7():
    print("")
    print("**You have opened Door 7**")
    print("Room 7: This room looks like a Child's Bedroom")
    flag = True
    while flag==True:
        print("")
        print("** You are in Room 7 **")
        choice=input("You can see... \na (W)ardrobe, \na (C)hest of drawers, \na (B)ed, \na Bedside (T)able \na (D)oor. \nWhere would you like to go to? ")
        if choice.lower() == "w":
            print("At the Wardrobe you see... <edit this response>") #beginner: edit this response
        elif choice.lower() == "c":
            print("At the Chest of Drawers you see... <edit this response>") #beginner: edit this response
        elif choice.lower() == "b":
            print("At the Bed you see... <edit this response>") #beginner: edit this response
        elif choice.lower() == "t":
            print("At the Bedside Table you see... <edit this response>") #beginner: edit this response
        elif choice.lower() == "d":
            print("You are leaving Room 7")
            flag=False
            landing()
        else:
            print("Your choice wasn't recognised. Please try again.")

def door8():
    print("")
    print("**You have opened Door 8**")
    print("Room 8: This room looks like a Bathroom")
    flag = True
    while flag==True:
        print("")
        print("** You are in Room 8 **")
        choice=input("You can see... \na (B)ath, \na (C)abinet, \na (T)oilet, \na (S)ink \na (D)oor. \nWhere would you like to go to? ")
        if choice.lower() == "b":
            print("At the Bath you see... <edit this response>") #beginner: edit this response
        elif choice.lower() == "c?":
            print("At the Cabinet you see... <edit this response>") #beginner: edit this response
        elif choice.lower() == "t":
            print("At the Toilet you see... <edit this response>") #beginner: edit this response
        elif choice.lower() == "s":
            print("At the Sink you see... <edit this response>") #beginner: edit this response
        elif choice.lower() == "d":
            print("You are leaving Room 8")
            flag=False
            landing()
        else:
            print("Your choice wasn't recognised. Please try again.")

def peter():
    print("")
    print("You have found a man hiding.")
    flag = True
    while flag==True:
        print("")
        choice=input("What would you like to do? \n(S)peak with the man or \n(L)eave the man alone.")
        if choice.lower() == "s":
            choice=input("What would you like to ask the man? \n(1)Who are you? \n(2)What are you doing here? \n(3)Are you okay? \n(4)Did you call the police? \n(5)What has happened? ")
            if choice == "1":
                #who are you?
                print("My name is Peter, this is my home, I live here.")
            elif choice == "2":
                #what are you doing here?
                print("After I called the police I hid in the wardrobe.")
            elif choice == "3":
                #Are you okay?
                print("I'm a bit shaken. When I heard you in the room I thought it was the intruders.")
            elif choice == "4":
                #did you call the police?
                print("Yes, I called the police.")
            elif choice == "5":
                #What has happened?
                print("<edit this response>") #beginner: edit this response
        elif choice.lower() == "l":
            flag = False

def start():
    print(">>> Storymaker - Created by Mr E Ryan <<<\n")
    print("Introduction: It is a dark evening. As the only inspector on duty at the police station you were sent to 64 Chadlington Street when the call came in. You approach the front door only to find it a little open. You call out but no one answers. You push open the door and cautiously enter the house.")
    hallway()

start()
