Weakest Quickest

The weakests could be the most dangerous.
弱いものが最も危険です。

目標

Survive 50 seconds.
Ogre shamans are casting a deadly spell, so hurry and defeat them first.
The weakest shamans are the quickest.
Attack them first, then the next weakest.
Be sure to attack the ogres with the least health, first.
50秒間生き残る。
オーガのシャーマンは致命的な呪文を唱えているので、まず急いで倒してください。
最も弱いシャーマンが一番速いです。
それらを最初に攻撃し、次に最も弱いものを攻撃する。
まず、健康状態が最も悪いオーグルを攻撃してください。

ヒント

Defeat shamans to survive.
The function find the weakest enemy.
生き残るためにシャーマンを倒す。
この関数は最も弱い敵を見つけます。


解答

a
def findWeakestEnemy():
  enemies = hero.findEnemies()
  weakest = None
  leastHealth = 99999
  enemyIndex = 0
  for enemy in enemies:
    if enemy.health<leastHealth:
      weakest=enemy
      leastHealth=enemy.health
  return weakest
while True:
  enemy=findWeakestEnemy()
  if enemy:
    hero.attack(enemy)
a

  • 最終更新:2017-09-09 23:11:11

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

認証パスワード