def go_north():
x = r - 1
def go_south():
x = r + 1
def go_west():
x = c - 1
def go_east():
x = c + 1
collumn = "c"
row= "r"
x = []
y = 0
row =3
collumn =9
while (y < row):
x.append ([])
y= y +1
y = 0
z = 0
while(z < row):
y=0
while(y < collumn):
x[z].append('*')
y=y+1
z=z+1
x[4][4] = "#"
raw_input ("")
if "w" = go_north:
else "s"= go_west:
else "a"= go_east:
elif "d"= go_west:
for y in x:
print y
的raw_input( “”)
当我运行此代码的任何部分时程序崩溃,我无法找到我的问题。 我可以去寻找解决方案的任何提示或地点? (看起来很愚蠢,实际程序中的缩进是正确的)
答案 0 :(得分:0)
这里有很多错误......
def go_north():
x = r - 1
def go_south():
x = r + 1
def go_west():
x = c - 1
def go_east():
x = c + 1
input = raw_input ("")
if input == "w":
go_north()
elif input == "s":
go_west()
elif input == "a":
go_east()
elif input == "d":
go_west()
我建议阅读python语法