极客战记-背靠背

 时间:2026-04-22 08:12:48

1、选择英雄和编程语言

极客战记-背靠背

2、选择装备

极客战记-背靠背

3、写中文注释

极客战记-背靠背

1、写代码

#循环

while True:

    #找敌人

    enemy = hero.findNearestEnemy()

    #如果有敌人

    if enemy:

        #攻击

        hero.attack(enemy)

    #否则

    else:

        #到中间

        hero.moveXY(40, 36)

极客战记-背靠背

2、运行

极客战记-背靠背

1、写代码

//循环

while(true) {

    //找敌人

    var enemy = hero.findNearestEnemy();

    //如果有敌人

    if (enemy){

        //攻击

        hero.attack(enemy);

    }

    //否则

    else{

        //到中间

        hero.moveXY(40, 36);

        }

}

极客战记-背靠背

2、运行

极客战记-背靠背

1、写代码

#循环

while true        

    #找敌人

    enemy = hero.findNearestEnemy()

    #如果有敌人

    if enemy    

        #攻击

        hero.attack(enemy)

    #否则

    else

        #到中间

        hero.moveXY(40, 36)

极客战记-背靠背

2、运行

极客战记-背靠背

1、写代码

--循环

while true do

    --找敌人

    local enemy = hero:findNearestEnemy()

    --如果有敌人

    if enemy then        

        --攻击

        hero:attack(enemy)

    --否则

    else

        --到中间

        hero:moveXY(40, 36)

    end

end

极客战记-背靠背

2、运行

极客战记-背靠背

  • 极客战记-逻辑之路
  • 极客战记-滑走
  • 极客战记-高山拉力
  • 极客战记-冰冻打击
  • 极客战记-边地僵局
  • 热门搜索
    关于动物的英语手抄报 手抄报小装饰 感恩的手抄报资料 二年级手抄报内容 诚信从我做起手抄报 有关法制的手抄报 我爱读书的手抄报 感恩的心手抄报资料 物理手抄报版面设计图 文明交通手抄报内容