轟くヤクの足
暴走している砂ヤクを垣根で囲って次の水場にたどり着く
目標
オアシスにたどり着く
Build "fence"s to block the yaks coming at you randomly from above and below.
Move right towards the oasis if you can't see a yak.
When you see a yak, compare its pos.y to your hero.pos.y.
If the yak's y position is greater than hero's, the yak is above the hero.
あなたで上と下から無作為に来るヤクを塞ぐために、「フェンス」sを築きなさい。
もしあなたがヤクを見ることができないならば、右をオアシスに動かしなさい。
あなたがヤクを見る時には、そのpos.yをあなたのhero.pos.yと比較しなさい。
もしヒーローのものよりヤクのyポジションが大きいならば、ヤクはヒーローの上にいる。
ヒント
ヤクのいる道を垣根("fence")で塞ぎながら、
オアシスにたどり着こう
解答
a
while True:
yak = hero.findNearestEnemy()
if yak:
if yak.pos.y>hero.pos.y:
hero.buildXY("fence", yak.pos.x, yak.pos.y-10)
if yak.pos.y<hero.pos.y:
hero.buildXY("fence", yak.pos.x, yak.pos.y+10)
else:
hero.moveXY(hero.pos.x+10, hero.pos.y)
a
- 最終更新:2017-05-11 00:37:39