70亿人吧 关注:428贴子:1,091

再开一贴,最全的攻略代码,全69关

只看楼主收藏回复

文库审核太慢了,一直显示提交中。
另外这几天不断优化了代码,很多关可以做到一段代码双星了。
此外还加入了很多最快纪录的代码
2楼开始上代码


IP属地:上海1楼2019-04-08 14:32回复
    【通关代码】
    //不知道制作团队怎么考虑的,分支关卡编号不连续
    //为了读者找起来方便,以下关卡顺序依然按照编号顺序,而不按分支顺序
    //以下代码全部经过测试,但因为是手打,不保证没有错漏,仅供参考
    1.你被录用了
    //过场动画
    2.欢迎新员工
    //指令数量挑战 and 速度挑战 //3行 1s
    //前几关的pickUp都不带方向参数,等同于后面的pickUp c
    step s
    pickUp
    drop
    3.运输小队
    //指令数量挑战 and 速度挑战 //5行 2s
    step s
    pickUp
    step s
    step s
    drop
    4.长途运输
    //指令数量挑战 and 速度挑战 //4行6s
    step e
    pickUp
    loop 1
    step e
    goto 1
    5.重要的抉择
    //指令数量挑战 and 速度挑战 //5行 2s
    if w==dataCube
    loop 1
    step w
    goto 1
    endif
    loop 2
    step e
    goto 2
    6.小小驱虫工1
    //指令数量挑战 and 速度挑战 //9行 3s
    step s
    step sw
    step sw
    step se
    step e
    step se
    step s
    step s
    pickUp
    7.整理房间
    //指令数量挑战 //5行 14s
    loop 1
    if s!=hole
    pickUp s
    step s
    goto 1
    endif
    drop
    //速度挑战 //9行 5s
    step s
    loop 1
    step s
    if s!=dataCube
    goto 1
    pickUp s
    loop 2
    step s
    if s!=hole
    goto 2
    drop
    8.员工激励大师
    //过场动画
    9.对角巷
    //指令数量挑战 and 速度挑战 //5行 5s
    pickUp s
    loop 1
    step s
    if nw!=dataCube
    goto 1
    drop
    //速度挑战 //26行 3s
    if se != dataCube
    pickUp s
    step s
    step s
    step s
    step s
    else
    if se != dataCube
    pickUp s
    step s
    step s
    step s
    else
    if se != dataCube
    pickUp s
    step s
    step s
    else
    if se != dataCube
    pickUp s
    step s
    else
    pickUp s
    endif
    endif
    endif
    endif
    step s
    step s
    drop
    10.疏散演习
    //10关之前都是教学关,比较简单。10关开始代码变得复杂起来
    //指令数量挑战 //9行
    loop 1
    if c==1
    step n
    endif
    if c==2
    step e
    endif
    if c==3
    step s
    endif
    if c==4 or c==null
    step w
    endif
    goto 1
    //速度挑战 //27行 14s
    //这里有个技巧,或者说可以利用的规则:
    //行走的时候如果前面是个工人,则会等待;
    //如果前面是个洞,当然会掉下去
    //而如果前面是墙壁、打印机、粉碎机之类无法行走又无法掉落的物体,则会自动结束行走
    //如此一来,如果想让许多人走同样的路线,可以让他们先向某个角落集合
    //如果碰到墙壁,自动会停止
    //所有人先在右下角集合,这样不管原来在哪里,现在都在右下角了
    step e
    step e
    step e
    step e
    step s
    step s
    step s
    step s
    //然后按照右下角的路径,直接走到目的地,无需做任何一个判断
    step w
    step w
    step w
    step w
    step w
    step nw
    step nw
    step sw
    step s
    step sw
    step w
    step w
    step w
    step nw
    step n
    step n
    step nw
    step n
    step n


    IP属地:上海3楼2019-04-08 14:33
    收起回复
      2025-08-21 15:39:13
      广告
      不感兴趣
      开通SVIP免广告
      11.注入数据1
      //指令数量挑战 //5行 10s
      pickUp s
      loop 1
      step s
      if c==dataCube or w!=dataCube
      goto 1
      endif
      drop
      //速度挑战 //8行 6s
      pickUp s
      step s
      step s //提前走两步
      loop 1
      step s
      step s //每次走2步
      if c==dataCube or w!=dataCube
      goto 1
      endif
      drop
      12.拉开拉链
      //指令数量挑战 and速度挑战 //8行 4s
      pickUp c
      loop 1
      if w==wall or sw==worker or se==worker
      step n
      drop
      endif
      if e==wall or nw==worker or ne==worker //两头同时拉开
      step s
      drop
      endif
      goto 1
      13.注入数据2
      //指令数量挑战 and速度挑战 //7行 15s
      pickUp s
      loop 1
      goto s
      if n==dataCube and se==null or w==worker
      step e
      endif
      if w!=dataCube or c!=null
      goto 1
      endif
      drop
      14.粉碎机入门
      //指令数量挑战 //4行 4s
      pickUp s
      step s
      step s
      giveTo s
      //速度挑战 //5行 2s
      if s==dataCube //员工自杀太浪费时间,加个判断就好了
      pickUp s
      step s
      step s
      giveTo s
      endif
      15.粉碎流水线
      //指令数量挑战 and速度挑战 //9行 23s
      loop 1
      loop 2
      step n
      if n==null
      goto 2
      endif
      pickUp n
      loop 3
      step s
      if s!=shredder
      goto 3
      endif
      giveTo s
      goto 1
      16.小小驱虫工2
      //指令数量挑战 //8行 12s
      loop 1
      step s
      if c!=dataCube
      goto 1
      endif
      pickUp c
      loop 2
      step e
      if s== shredder
      giveTo s
      endif
      goto 2
      //速度挑战 //14行 8s
      step s
      step s
      step s
      loop 1
      step s
      if c!=dataCube
      goto 1
      endif
      pickUp c
      step e
      step e
      step e
      step e
      step s
      step e
      give to e
      17.内容产出
      //指令数量挑战 and速度挑战 //1行 2s
      pickUp s
      18.独特偏爱
      //指令数量挑战 and速度挑战 //6行 12s
      pickUp w
      step sw
      loop 1
      if s!= shredder
      step se
      goto 1
      endif
      giveTo s
      //速度挑战 //12行 7s
      pickUp w
      step sw
      step se
      step se
      step se
      step se
      step se
      step se
      step se
      step se
      step se
      giveTo s
      19. 内容产出-问题修复
      //指令数量挑战 and速度挑战 //4行 26s
      step e
      loop 1
      takeFrom sw
      giveTo se
      goto 1
      20. 反转流水线
      //指令数量挑战 and速度挑战 //9行 11s
      pickUp s
      loop 1
      if sw!=hole
      step w
      goto 1
      endif
      step s
      loop 2
      if e!=hole and e!=dataCube
      step e
      goto 2
      endif
      drop
      //最快速度 //58行 4s
      //由于需要做许多嵌套判断,为了书写方便,也为了读者不会将不同的if看窜行
      //这里将不同的分支用不同的if括起来,并使用end指令直接终止
      //而不把后续代码写进else里
      if sw!=dataCube or se!=dataCube //两侧的最先走
      pickUp s
      if sw==hole
      step se //避免路线交叉,靠墙走
      step se
      step e
      step e
      step e
      step e
      step ne
      else
      step sw
      step sw
      step w
      step w
      step w
      step w
      step nw
      endif
      drop
      end
      endif
      if sw!=dataCube or se!=dataCube //第二位再走
      pickUp s
      if e==worker
      step s //避免路线交叉,靠墙走
      step se
      step e
      step e
      step e
      step ne
      else
      step s
      step sw
      step w
      step w
      step w
      step nw
      endif
      drop
      end
      endif
      if sw!=dataCube or se!=dataCube //第三位
      if w==worker
      pickUp s //这里要先判断再拿起,否则周围人都走光了没法知道自己是谁
      step e //直接走最短路线
      step e
      step se
      else
      pickUp s
      step w
      step w
      step sw
      endif
      drop
      end
      endif
      step s//最中间直接走
      if e==dataCube
      pickUp e
      drop
      end
      endif
      pickUp w
      drop


      IP属地:上海4楼2019-04-08 14:34
      回复
        第24关, 最速代码这边试了是54步,达不到你的49步, 代码中少一个endif 不过放在中间和放最后我都试了都是54步


        IP属地:福建10楼2019-04-09 13:10
        收起回复
          57.扫雷邻居
          //速度挑战 //36行 34s
          if e==wall
          mem3=1
          endif
          loop 1
          mem2=0
          if mem3==0
          step e
          else
          step w
          endif
          if c==dataCube
          forEachDiras mem2
          if mem1>=0 //这里完全使用判断代替加法,速度快三倍
          if mem1>3
          if mem1>5
          if mem1==7
          mem1=8
          else
          mem1=7
          endif
          else
          if mem1==5
          mem1=6
          else
          mem1=5
          endif
          endif
          else
          if mem1>1
          if mem1==3
          mem1=4
          else
          mem1=3
          endif
          else
          if mem1==1
          mem1=2
          else
          mem1=1
          endif
          endif
          endif
          endif
          endForEach
          endif
          pickUp c
          write mem1
          drop
          goto 1


          IP属地:上海11楼2019-04-11 08:36
          收起回复
            66.十进制计数器
            //速度挑战 //57行 71s
            if e==null
            mem1=1 //初始计数
            mem4=1 //是否末位
            endif
            pickUp s
            step s
            step s
            if nw==worker
            loop 1
            tell all ‘Start!’
            step w
            listen ‘OK!’
            step e
            goto 1
            endif
            drop
            loop 2 //计算器
            listen ‘Start!’
            pickUp c
            if mem1>4 //用if代替加法,二分法减少判断次数
            if mem1>6
            if mem1==9
            mem1=0
            else
            if mem1==8
            mem1=9
            else
            mem1=8
            endif
            endif
            else
            if mem1==6
            mem1=7
            else
            mem1=6
            endif
            endif
            else
            if mem1>2
            if mem1==4
            mem1=5
            else
            mem1=4
            endif
            else
            if mem1==2
            mem1=3
            else
            if mem1==1
            mem1=2
            else
            mem1=1
            endif
            endif
            endif
            endif
            if mem1==0
            mem2=1 //进位
            endif
            if mem4==1
            write mem1
            tell all ‘OK!’
            else
            if myItem==0 and mem2==1 and mem1==9
            write 1
            endif
            if myItem==9 and mem2==1 and mem1==9
            write 0
            endif
            if myItem==8 and mem2==0 and mem1==9
            write 9
            endif
            endif
            drop
            goto 2
            其实不仅是这一关,所有需要做加法的关都可以用if代替,能节省时间


            IP属地:上海12楼2019-04-11 08:49
            回复
              50.无声交流
              //速度挑战 //17行 42s
              //很多人也许会奇怪,这关还能再快?
              mem1=sw
              step e
              loop 1
              if mem1==1
              takeFrom sw
              giveTo se
              mem1=4
              else
              if mem1==2
              mem1=1
              endif
              if mem1==3
              mem1=2
              endif
              if mem1==4
              mem1=3
              endif
              if c==null //连续3个if,纯粹是为了延迟,否则计算太快会同时使用粉碎机
              endif
              if c==null
              endif
              if c==null
              endif
              endif
              goto 1


              IP属地:上海13楼2019-04-11 09:01
              回复
                13.注入数据2
                //速度挑战 //57行 6s
                if se!=dataCube
                pickUp s
                step se
                step se
                step s
                step s
                step s
                step s
                step s
                step s
                step s
                else
                if se!=dataCube
                pickUp s
                step se
                step s
                step s
                step s
                step s
                step s
                step s
                step s
                step s
                else
                if se!=dataCube
                pickUp s
                step se
                step se
                step se
                step se
                step se
                step se
                step s
                else
                if se!=dataCube
                pickUp s
                step se
                step se
                step se
                step e
                step e
                else
                if se!=dataCube
                pickUp s
                step se
                step s
                step s
                step s
                step s
                else
                pickUp s
                step s
                step s
                step s
                step s
                step s
                endif
                endif
                endif
                endif
                endif
                drop


                IP属地:上海14楼2019-04-16 08:07
                回复
                  2025-08-21 15:33:13
                  广告
                  不感兴趣
                  开通SVIP免广告
                  58.好邻居
                  //速度挑战 //97行 26s
                  mem4= nearest wall
                  step mem4
                  if n==wall or s==wall
                  if n==wall
                  step w //走13步到角,这里可以用循环代替,但是会慢几秒
                  step w
                  step w
                  step w
                  step w
                  step w
                  step w
                  step w
                  step w
                  step w
                  step w
                  step w
                  step w
                  step se //走5步到中间
                  step se
                  step se
                  step se
                  step se
                  else
                  step e
                  step e
                  step e
                  step e
                  step e
                  step e
                  step e
                  step e
                  step e
                  step e
                  step e
                  step e
                  step e
                  step nw
                  step nw
                  step nw
                  step nw
                  step nw
                  endif
                  else
                  if w==wall
                  step s //走11步到角
                  step s
                  step s
                  step s
                  step s
                  step s
                  step s
                  step s
                  step s
                  step s
                  step s
                  step ne
                  step ne
                  step ne
                  step ne
                  step ne
                  else
                  step n
                  step n
                  step n
                  step n
                  step n
                  step n
                  step n
                  step n
                  step n
                  step n
                  step n
                  step sw
                  step sw
                  step sw
                  step sw
                  step sw
                  endif
                  endif
                  mem1=nearest dataCube
                  if mem1==8
                  pickUp mem1
                  else
                  end
                  endif
                  step mem4
                  loop 2
                  if c!=dataCube
                  drop
                  else
                  if e==wall
                  step n
                  else
                  if w==wall
                  step s
                  else
                  if n==wall
                  step w
                  else
                  step e
                  endif
                  endif
                  endif
                  goto 2
                  endif
                  goto 1


                  IP属地:上海15楼2019-04-18 09:09
                  回复
                    第37关,双星13/13, 32/32
                    loop 1
                    if e==hole
                    step se
                    if ne==hole
                    step e
                    end if
                    step ne
                    else
                    step e
                    end if
                    if e!=wall
                    mem1 = calc mem1 + c
                    goto 1
                    end if
                    pickup c
                    write mem1
                    drop


                    IP属地:福建16楼2019-05-06 12:47
                    回复
                      给力


                      IP属地:广东来自iPhone客户端17楼2019-07-20 17:55
                      回复
                        我看不懂啊⊙_⊙


                        来自Android客户端18楼2021-09-18 15:30
                        收起回复
                          loop 1
                          if c==1
                          step n
                          endif
                          if c==2
                          step e
                          endif
                          if c==3
                          step s
                          endif
                          if c==4 or c==null
                          step w
                          endif
                          goto 1


                          来自Android客户端19楼2022-02-21 02:10
                          回复
                            13年 注入数据2
                            速度挑战 5s;
                            //将14楼的最后一个else if (否则-如果)变成else(否则)也可以,这里提供一种新的方法,两边同时进行,但是一方面是咱太菜了,一方面是拖的太累了,最终没能完全实现。
                            -- 7 Billion Humans (2235) --
                            -- 13: 注入数据 2 --
                            if se != datacube:
                            pickup s
                            step se
                            step se
                            step s
                            step s
                            step s
                            step s
                            step s
                            step s
                            step s
                            else:
                            if se != datacube:
                            pickup s
                            step se
                            step s
                            step s
                            step s
                            step s
                            step s
                            step s
                            step s
                            step s
                            jump a
                            else:
                            if se != datacube:
                            pickup s
                            step se
                            step se
                            step se
                            step se
                            step se
                            step se
                            step s
                            jump b
                            else:
                            if se != datacube:
                            pickup s
                            step se
                            step s
                            step e
                            step se
                            step e
                            step e
                            jump c
                            endif
                            endif
                            endif
                            if sw != datacube:
                            pickup s
                            step s
                            step s
                            step s
                            step s
                            step s
                            else:
                            pickup s
                            step se
                            step s
                            step s
                            step s
                            step s
                            endif
                            endif
                            c:
                            b:
                            a:
                            drop
                            comment 0
                            DEFINE COMMENT 0
                            eJzjYQACSYYOENVgC6EZyhiegemlDPfA9DIGPbD8cSBrFIyCUTCsAACUWQeT;


                            IP属地:浙江20楼2023-07-11 14:13
                            收起回复
                              2025-08-21 15:27:13
                              广告
                              不感兴趣
                              开通SVIP免广告
                              楼主写的好啊,


                              IP属地:新疆来自Android客户端22楼2023-07-18 20:47
                              回复