立方雷区,这一关总是报错.有大神知道吗
codecombat吧
全部回复
仅看楼主
level 1
小刀在线 楼主
如图的报错。有大神知道怎么修改吗
2017年02月20日 17点02分 1
level 1
如果没记错,tower = hero.findByTypes("tower")[0]
2017年02月21日 01点02分 2
不是这个,看我楼下的截图. 还是报错.
2017年02月21日 14点02分
level 1
小刀在线 楼主
2017年02月21日 14点02分 3
level 3
# 穿过雷区
# 这个函数返回乘以次数的数字。
def mult(number, times):
total = 0
while times > 0:
total += number
times -= 1
return total
# 这个函数返回乘方的数字。
def power(number, exponent):
total = 1
# 补全函数。
while exponent > 0:
total *= number
exponent -= 1
return total
# 别修改这些代码
# You can find coefficients for the equation on the tower
tower = hero.findFriends()[0]
a = tower.a
b = tower.b
c = tower.c
d = tower.d
x = hero.pos.x
while True:
# To find the path use a cubic equation
y = a * power(x, 3) + b * power(x, 2) + c * power(x, 1) + d * power(x, 0)
hero.moveXY(x, y)
x = x + 5
2017年02月22日 07点02分 4
真是奇怪的很,点了重新开始,所有的都重置了.和你的代码一模一样,还是出现一楼的报错...
2017年02月23日 16点02分
@小刀在线 英文输入法,注意全角半角。我的都通过了的,卡在后面了。
2017年02月24日 08点02分
@张栩烽 今天终于发现是哪里错了..戴的眼镜装备中,没有FindFriends这个函数.. ....谢谢你多次的 回复.
2017年02月28日 14点02分
level 3
没做对的时候,点 重新开始。
2017年02月22日 07点02分 5
level 1
要买个红木眼镜
2017年03月20日 13点03分 6
1