我在
处遇到语法错误 if first2 == 1:
import time
name = raw_input("What is your name? ")
print "Hello, " + name
time.sleep(1.5)
print "Welcome to Kill the Dragon."
time.sleep(2)
print "In this game, you will choose an option, and if you make the right
choices, you will slay the dragon."
time.sleep(5)
print "You are walking through a forest on a cold, damp, windy night."
time.sleep(3)
print "You see a castle, and as you are looking for a shelter, you decide to try your luck there."
time.sleep(3)
print "You are greeted by a knight in shining armor. He gives you a questioning look. What do you say?"
time.sleep(1)
first = int(raw_input("1: Say you are looking for shelter from the storm " "\n2: Say you are lost and need food "))
time.sleep(2)
if first == 1:
print "Ok, " + name + ",we could all use some help from this bad storm outside. Please let me lead you to a good place."
time.sleep(4)
print "After a good dinner, you ask if there is anything you can do to help."
time.sleep(2)
print "Well... There is one thing you can do. A dragon located in Eucalyptus Cave has been causing many problems lately./nIf you kill the dragon, we will give you a large reward."
time.sleep(1)
first2 = int(raw_input("1. Tell the knight you will kill the dragon.\n2. Tell the knight you will not kill the dragon. ")
if first2 == 1:
print "Oh, good. If you had declined, we would have thrown you into the dungeons.
if first2 == 2:
print "You will not kill the dragon for us? Off to the dungeons it is!"
time.sleep(1.2)
print "SLAM!"
if first == 2:
print "Ugg, I hate filthy peasants! Maybe if you kill the dragon living in that cave over there, we will let you stay."
time.sleep(4)
second2 = int(raw_input("1: Insist on getting inside the castle" + "\n2: Ask the knight for armor, a weapon, and a steed"))
if second2 == 1:
print "The knight tells you to get lost, and that the deal is off."
if second2 == 2:
print "The knight gives you things, and you set out to slay the dragon."
time.sleep(3)
second3 = raw_input ("Once you arrive at the cave, you see two ways to go. Should you go right or left? ")
if second3 == "right":
print "You are greeted by the carcusses of many older knights who died trying to battle the dragon. \nYou wish you didn't see it, and turn back to go the other way."
second3 = "left"
if second3 == "left":
print "You are greeted by the sleeping, green, slimy, two-headed dragon. \n He is sleeping, but he smells you and wakes up. \nHe is about to stand up. \nWhat do you do? "
答案 0 :(得分:0)
if first2 == 1:
print "Oh, good. If you had declined, we would have thrown you into the dungeons.
在末尾添加引号
if first2 == 1:
print "Oh, good. If you had declined, we would have thrown you into the dungeons."