I am writing a text adventure game in which the user inputs information. I am having problems when I try to add the users name and accessory into the game. Basically I am having a problem implementing custom user input.
<code>def welcome():
name()
accessory()
print(str(name) + """, you are a sleep in the quarters of the fine ship named ___. Starting to wake up you here your captain yelling at the crew. You think its best if you get up now. What is your response?""")
option = input("> ")
if option == "wake" or option == "Wake":
wake_up()
else:
welcome()
def wake_up():
print("""You are now awake and ready to start the day. You head down into your room puting on your """ + str(accessory) + """, seeing a backpack off to the
corner. As the software engineer it is your job to work on the electronics and maintain the ships systems. """)
option = input("> ")
if option == "west":
west()
elif option == "east":
east()
elif option == "south":
south()
elif option == "north":
north()
def take():
print("""You have collected a backpack which contains: a computer, a guide to grues, programming and sci-fi books and the gravity falls dvd set.""")
def west():
print("""You head west to find the lunchroom. Filled with all sorts of wonderful foods.""")
def north():
print()
def east():
print()
def south():
print()
def name():
name = input("What is your name: ")
def accessory():
accessory = input("What is your accessory: ")
welcome()
</code>
<code>def welcome():
name()
accessory()
print(str(name) + """, you are a sleep in the quarters of the fine ship named ___. Starting to wake up you here your captain yelling at the crew. You think its best if you get up now. What is your response?""")
option = input("> ")
if option == "wake" or option == "Wake":
wake_up()
else:
welcome()
def wake_up():
print("""You are now awake and ready to start the day. You head down into your room puting on your """ + str(accessory) + """, seeing a backpack off to the
corner. As the software engineer it is your job to work on the electronics and maintain the ships systems. """)
option = input("> ")
if option == "west":
west()
elif option == "east":
east()
elif option == "south":
south()
elif option == "north":
north()
def take():
print("""You have collected a backpack which contains: a computer, a guide to grues, programming and sci-fi books and the gravity falls dvd set.""")
def west():
print("""You head west to find the lunchroom. Filled with all sorts of wonderful foods.""")
def north():
print()
def east():
print()
def south():
print()
def name():
name = input("What is your name: ")
def accessory():
accessory = input("What is your accessory: ")
welcome()
</code>
def welcome():
name()
accessory()
print(str(name) + """, you are a sleep in the quarters of the fine ship named ___. Starting to wake up you here your captain yelling at the crew. You think its best if you get up now. What is your response?""")
option = input("> ")
if option == "wake" or option == "Wake":
wake_up()
else:
welcome()
def wake_up():
print("""You are now awake and ready to start the day. You head down into your room puting on your """ + str(accessory) + """, seeing a backpack off to the
corner. As the software engineer it is your job to work on the electronics and maintain the ships systems. """)
option = input("> ")
if option == "west":
west()
elif option == "east":
east()
elif option == "south":
south()
elif option == "north":
north()
def take():
print("""You have collected a backpack which contains: a computer, a guide to grues, programming and sci-fi books and the gravity falls dvd set.""")
def west():
print("""You head west to find the lunchroom. Filled with all sorts of wonderful foods.""")
def north():
print()
def east():
print()
def south():
print()
def name():
name = input("What is your name: ")
def accessory():
accessory = input("What is your accessory: ")
welcome()
New contributor
SquawkChic is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.