极客战记-穿越
如果你卡在这里了,那么看看这个攻略吧
准备工作
1、选择英雄和编程语言
2、选择装备
3、写中文注释
python
1、写代码#Don'tinsultthistribeofpeacefulogres.whileTrue:item=hero.findNearestItem()ifitem:#Ifitem.typeISNOTEQUALTO"gem"ifitem.type!="gem":#然后跟随你的宠物。hero.moveXY(pet.pos.x,pet.pos.y)#否则:else:#移动到宝石的坐标。hero.moveXY(item.pos.x,item.pos.y)
2、运行
javascript
1、写代码// 不要侮辱烂瘀佐栾这个和平食人魔部落while(true) { var item = hero.findNear髫潋啜缅estItem(); 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、运行
coffeescript
1、写代码# Don补朱锚卦39;t insult this tribe of peaceful ogres.w茑霁酌绡hile 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、运行
lua
1、写代码-- 不要侮辱烂瘀佐栾这个和平食人魔部落while true do local item = hero:findNe锾攒揉敫arestItem() 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 endend
2、运行