极客战记-背靠背

 时间:2026-02-12 12:55:50

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、运行

极客战记-背靠背

  • 极客战记-逻辑之路
  • 极客战记-滑走
  • 极客战记-高山拉力
  • 极客战记-冰冻打击
  • 极客战记-边地僵局
  • 热门搜索
    书香满园手抄报 手抄报模板图片 飞向太空手抄报 励志手抄报图片 语文手抄报三年级 送别诗手抄报 校园手抄报 手抄报图案大全 清明时节祭英烈手抄报 关于元旦的英语手抄报