求救啊森林的long-range division怎么过
codecombat吧
全部回复
仅看楼主
level 1
雷戴宇😄 楼主
完全看不懂网上也没有,不会写求助大神
2018年08月04日 09点08分 1
level 1
雷戴宇😄 楼主
找到了
enemy = hero.findNearestEnemy()
distanceToEnemy = hero.distanceTo(enemy)
# Say first Range: distanceToEnemy divided by 3
hero.say("first Range"+distanceToEnemy/3)
hero.say("Fire!")
# Say second range: distanceToEnemy divided by 1.5
hero.say("second range"+distanceToEnemy/1.5)
hero.say("Fire!")
# Say these things for motivation. Really. Trust us.
hero.say("Woo hoo!")
hero.say("Here we go!")
hero.say("Charge!!")
while True:
enemy=hero.findNearestEnemy()
hero.attack(enemy)
2018年08月04日 10点08分 2
1