当前位置:网站首页 > 创业 > 正文

极客战记-穿越

0 张子豪 张子豪 2025-10-12 02:29 1

若是你卡在这里了,那么看看这个攻略吧

筹办工作

  1. 1

    选择英雄和编程说话

  2. 2

    选择装备

  3. 3

    写中文注释

python

  1. 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. 2

    运行

javascript

  1. 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. 2

    运行

coffeescript

  1. 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. 2

    运行

lua

  1. 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. 2

    运行

来源:百闻(微信/QQ号:9397569),转载请保留出处和链接!


本文链接:https://www.ibaiwen.com/web/234858.html

张子豪

张子豪

TA很懒,啥都没写...

@百闻娱乐 本站部分内容转自互联网,若有侵权等问题请及时与本站联系,我们将在第一时间删除处理。 | 粤ICP备2024343649号 | (地图