砂漠での戦い

巨大な敵を倒すために、兵たちに壮大なスピーチをする

目標

鬼は死ななければならない。

Be sure to increment your while loop condition or you will get stuck in an infinite loop!
必ずあなたの間のループ条件をインクリメントしなさい。さもなければ、あなたは、無限ループに貼り付けられる!

var orderGiven=0;
while(orderGiven<5){
//If you don't do this,the loop will never end!
 orderGiven+=1;
}

ヒント

whileループは条件が偽となるまで(真である限り)繰り返される
whileループの中で、何か条件を偽に近づけることをしよう!そうしなければ、ずっと続く

8メートル下に移動して、味方が戦いに加わるように命令しよう。あなたが味方のちょうど前に立っている場合だけ声が届く!

Be sure to increment ordersGiven!

命令を出し終わったら、戦いに加わろう

解答

a
var ordersGiven = 0;
while (ordersGiven < 5) {
hero.moveXY(10,hero.pos.y-10);
hero.say("Attack!");
ordersGiven+=1;
while(true) {
var enemy = hero.findNearestEnemy();
if(enemy){hero.attack(enemy);
a

  • 最終更新:2016-05-12 00:27:58

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

認証パスワード