Hello, I'm totally new to programming and wanted to make a text-based game based on what I know, but I've met a problem I don't know how to fix. Also this code is not finished, I'm just trying to get it to work first.
Basically, I want the loop to re-start. I tried many different ways, but none worked.
Again, I'm totally new to programming and am sorry if everything is completely wrong. Here's the code:
start = raw_input("Enter Start to start the game:") if start == "Start" or "start": print "Welcome to the game!" print "Your adventure starts in your home." houseDecision = raw_input ("After you left the house the path continued two different ways. Which path would you like to take? (Left, Right)") while houseDecision == "Right": fightorRun = raw_input("You started walking to the right and a Ghoul jumped at you from the tall grass. What would you like to do? (Run back, Fight)") if fightorRun == "Run back": houseDecision = raw_input("You ran back where the two ways parted. Which way would you like to choose now? (Left, Right)") while houseDecision == "Left": pickup = raw_input("When you took the left path you found an Iron Sword hidden in the grass. Take it? (Yes, No)") if pickup == "Yes": inventory.append("Iron Sword") print "You took the Iron Sword into your inventory." goback = raw_input("Do you want to continue going or go back? (Continue, Back)") if goback == "Back": houseDecision = raw_input("Where do you want to go? (Left, Right)")
I want to go from line 18 to line 6.
Edited 2 Months Ago by Artur_5