会計係

勝利と金を数える間に時計を見て時間に注意する.

目標

オ-ガの負けをファーストウェ-ブに報告する.
集めた金の報告
オ-ガの負けをセカンドウェ-ブに報告する.

This level has three phases:
Collect coins for 15 seconds.
Fight more ogres for 15 seconds.

Tell Naria your total victories or gold after each phase.
Use time to check the time, and break to cancel while a loop.
このレベルは3つのフェーズを持っている:
15秒の間コインを収集しなさい。
15秒の間より多くの怪物と戦いなさい。

個々のフェーズの後にあなたの全体の勝利または金をNariaに話しなさい。
時間をチェックする時間を使い、キャンセルする 間 ループ ために壊れなさい。


ヒント

15秒間敵と戦う
敵を倒す度に数を数えておく

解答

a
defeated = 0
while True:
  enemy = hero.findNearestEnemy()
  if enemy:
    hero.attack(enemy)
    if enemy.health <= 0:
      defeated += 1
  if hero.time > 15:
    break
hero.moveXY(59, 33)
hero.say(defeated)
while True:
  item = hero.findNearestItem()
  hero.moveXY(item.pos.x, item.pos.y)
  if hero.time > 30:
    break
hero.moveXY(59, 33)
hero.say(hero.gold)
defeated = 0
while True:
  enemy = hero.findNearestEnemy()
  if enemy:
    hero.attack(enemy)
    if enemy.health <= 0:
      defeated += 1
  if hero.time > 45:
    break
hero.moveXY(59, 33)
hero.say(defeated)
a

  • 最終更新:2017-05-14 12:11:38

このWIKIを編集するにはパスワード入力が必要です

認証パスワード