极客战记-穿越

2025-10-28 04:29:12

1、选择英雄和编程语言

极客战记-穿越

2、选择装备

极客战记-穿越

3、写中文注释

极客战记-穿越

1、写代码

# Don't insult this tribe of peaceful ogres.

while True:

    item = hero.findNearestItem()

    if item:

        # If item.type IS NOT EQUAL TO "gem"

        if item.type != "gem":

            # 然后跟随你的宠物。

            hero.moveXY(pet.pos.x, pet.pos.y)

        # 否则:

        else:

            # 移动到宝石的坐标。

            hero.moveXY(item.pos.x, item.pos.y)

极客战记-穿越

2、运行

极客战记-穿越

1、写代码

// 不要侮辱这个和平食人魔部落

while(true) {

    var item = hero.findNearestItem();

    if(item) {

        // 如果item.type不等于 "gem"

        if(item.type != "gem") {

            // 然后跟随你的宠物。

            hero.moveXY(pet.pos.x, pet.pos.y);

        }

        // 否则:

        else {

            // 移动到宝石的坐标。

            hero.moveXY(item.pos.x, item.pos.y);

        }

    }

}

极客战记-穿越

2、运行

极客战记-穿越

1、写代码

# Don't insult this tribe of peaceful ogres.

while true        

    item = hero.findNearestItem()

    if item

        # If item.type IS NOT EQUAL TO "gem"

        if item.type != "gem"

            # 然后跟随你的宠物。

            hero.moveXY(pet.pos.x, pet.pos.y)

        # 否则:

        else

            # 移动到宝石的坐标。

            hero.moveXY(item.pos.x, item.pos.y)

极客战记-穿越

2、运行

极客战记-穿越

1、写代码

-- 不要侮辱这个和平食人魔部落

while true do

    local item = hero:findNearestItem()

    if item then

        -- 如果item.type不等于 "gem"

        if item.type ~= "gem" then

            -- 然后跟随你的宠物。

            hero:moveXY(pet.pos.x, pet.pos.y)

        -- 否则:

        else

            -- 移动到宝石的坐标。

            hero:moveXY(item.pos.x, item.pos.y)

        end

    end

end

极客战记-穿越

2、运行

极客战记-穿越

声明:本网站引用、摘录或转载内容仅供网站访问者交流或参考,不代表本站立场,如存在版权或非法内容,请联系站长删除,联系邮箱:site.kefu@qq.com。
相关推荐
  • 阅读量:172
  • 阅读量:144
  • 阅读量:91
  • 阅读量:74
  • 阅读量:98
  • 猜你喜欢