《70亿人》手机游戏满星攻略V2.1涂版

《70亿人》全星通关攻略(全69关)
【通关原则】
·指令数量挑战:
规则:使用的代码行数少于系统规定的行数
代码尽量复用就不说了,是程序员都懂,只针对游戏本身的规则注意以下原则
1.选取简单的方案,尽量通过重复简单动作达成
2.不要追求代码优雅,比如确保工人不死或所有动作完成后工人动作结束,除非工人乱动会影响后续结果
3.如果必要,不写判断。
比如拿起一个方块之前如果不判断手中无方块并且地上有方块,工人就会报一个错误,这会增加执行时间。即使因此导致某些情况下代码执行超时也无所谓,反正有任意一次能执行成功就可以了
·速度挑战:
规则:在一倍速下运行所需要的真实时间。由于有些关卡存在随机数和随机行走问题导致时间不确定,取25次的平均值。
1.可以选取稍微复杂但更有效率的方案,比如需要多人配合的。但不要追求复杂。很多情况下简单的也是有效的。
2.如无必要,不做判断。判断也需要时间,尤其是需要与周围进行对比的。
如果需要根据不同的初始位置执行不同的动作,那么最好在一开始就做好判断,而不要在不断的问“我是谁?”的过程中耗尽时间
3.一切为了效率,即使偶尔会执行失败,只要平均时间短就足够了
【名词解释】
为方便书写和避免歧义,以下代码采用C语言语法书写,一句代码一行,结尾不写分号
对于游戏中自定义物体和函数,将用代码代替,代码中将不会出现中文
以英文版游戏中的命名方式为基础全部做了简化处理
反正你也没法把这些代码直接粘到游戏里去,能看懂就行了
命名方式如下
【方位和物体】
柯布上→n //short for ‘north’
下→s //short for ‘south’
左→w //short for ‘west’
右→e //short for ‘east’
中→c //short for ‘center’
左上→nw
左下→sw
右上→ne
右下→se
任意方向→anyDir
我的物件→myItem
某个东西→something //完全等同于非空,是个多余的东西,以下代码绝对不会用到
无→null
一个数据方块→dataCube
一名工人→worker
一个洞→hole
一堵墙→wall
粉碎机→shredder
打印机→printer
记忆体1→mem1
记忆体2→mem2
记忆体3→mem3
记忆体4→mem4
【命令】
行走→step+方向
拿起→pickUp
放下→drop
写下→write
给出→giveTo
拿取→takeFrom
最接近的→nearest
计算→ =
设置为→ =
如果→if
否则→else
结束如果→endif
跳转goto
跳转到→loop
举例:
loop 1
goto 1
//注意数字是一一对应的,涉及到多个跳转的时候要看好
//以下代码涉及到的跳转一定是大跳转包含小跳转,不存在交叉跳转的情况
//如果出现此情况,说明抄代码的时候抄窜行了
终止→end //基本上是个鸡肋,以下基本不会用到此命令(有个别极特殊情况不得不用)
//我一直认为好的程序完全可以用if保证程序进入正确的分支,而不使用end
//end除了让可读性变差,让人摸不清思路,没有什么好的作用
巡视→forEachDir as
巡视结束→endFor
告诉→tell
聆听→listen
【比较和赋值】
=  →等号右边的值给左边
== →相等
!= →不等
>  →大于
播种希望的种子
>= →大于或等于
<  →小于
<= →小于或等于
and→和
or →或
【计算】
加法→+
减法→-
乘法→*
除法→/
【其他说明】
// →注释符,表示此行文字是写给玩家看的,不执行
关于行数计算,成对出现的如gotoloop,算做一行,ifendif算做一行
但如果出现else则单独算一行
=========================================================
【通关代码】
//不知道制作团队怎么考虑的,分支关卡编号不连续
//为了读者起来方便,以下关卡顺序依然按照编号顺序,而不按分支顺序
//以下代码全部经过测试,但因为是手打,不保证没有错漏,仅供参考
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
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
//速度挑战 //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
14.粉碎机入门
//指令数量挑战 //4行 4s
pickUp s
step s
step s
giveTo s

本文发布于:2024-09-21 13:48:57,感谢您对本站的认可!

本文链接:https://www.17tex.com/xueshu/612877.html

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。

标签:代码   时间   需要   跳转   工人   动作   判断   比如
留言与评论(共有 0 条评论)
   
验证码:
Copyright ©2019-2024 Comsenz Inc.Powered by © 易纺专利技术学习网 豫ICP备2022007602号 豫公网安备41160202000603 站长QQ:729038198 关于我们 投诉建议