求大神帮忙呀……卡在这快一个寒假了……
codecombat吧
全部回复
仅看楼主
level 2
雷桑S逸 楼主
2017年02月08日 07点02分 1
level 2
雷桑S逸 楼主
无论如何都过不去[泪][泪][泪]
2017年02月08日 07点02分 2
level 1
最后一个enemyDistance不要加引号
人家让你说eD的值,你加引号只会说出eD这个函数名
2017年02月08日 09点02分 3
level 3
我也刚玩,陪小朋友学习。昨天过了这关。
2017年02月08日 10点02分 4
level 3
# It's an ambush and your only weapon is the old, blind wizard.
# Your task is to tell him the distance to the coming ogres.
# This function finds the nearest enemy and returns the distance to it.
# If there is no enemy, the function returns 0.
def nearestEnemyDistance():
enemy = hero.findNearestEnemy()
result = 0
if enemy:
result = hero.distanceTo(enemy)
return result
while True:
# Call nearestEnemyDistance() and
# save the result in the variable "distance"
distance = nearestEnemyDistance()
# If the variable "distance" is greater than 0:
if distance > 0:
# Say the value of "distance" variable.
hero.say(distance)
2017年02月09日 04点02分 5
level 3
春雷怎么过?一个寒假了呜呜
2017年02月09日 04点02分 6
level 2
if enemyDistance>0:
hero.say(enemyDistance)
2017年04月14日 08点04分 7
1