- 积分
- 1073
- 威望
- 0
- 魅力
- 0
- 经验
- 28
- 热心度
- 0
- 注册时间
- 2006-12-12
- 最后登录
- 2018-6-5
- 主题
- 50
- 回帖
- 236
- 精华
- 0
- 阅读权限
- 40
TA的每日心情 | 擦汗 2014-2-3 08:29 |
---|
签到天数: 1 天 连续签到: 1 天 [LV.1]投石矮人

4级 Famous Hero

- 积分
- 1073
|

楼主 |
发表于 2011-9-13 11:21:08
|
显示全部楼层
……既然那么多人有兴趣,那我把原版代码贴出来方便讨论吧:
第一个问题:“孤独”的隐士相关的代码如下:
** function to handle antisocial hermit
!?FU775;
!!VRv611:S0; [assume no occupants]
!!VRv614:S0; [assume no hermits]
!!FU768:P612/998; [read split cave bits into v612]
!!VRv612:&3; [just look at number of additional caves, 0-3]
!!DO781/0/3/1:Pv612; [check each cave's living occupants]
!!IF&v611>1:M1/z130240;
!!FU766:Px1/613/998; [read cave's bits into v613]
!!VRv613:&115; [clear hermit requirement bits]
!!FU767&v611<2:Px1/v613/998; [store new cave bits]
!!VRz360:Sz130241;
!!VRv615&v611<2:S1; [hermit is usable only if alone]
** end of function
** function to check cave x16 for occupants, x1 # of extra caves
!?FU781;
!!FU766:Px16/613/998; [read cave x16's bits into v613]
!!VRy1:Sv613 &3; [type of cave in y1]
!!VRy2:Sv613 :64; [occupied or not in y2]
!!VRv611&x1>=x16/y2=0/y1<3:+1; [count occupants, including hermit himself]
!!VRv614&x1>=x16/y2=0/y1=1:+1; [count hermits]
!!VRz361&x1>=x16/y2=0/y1=0:Sz130244;
!!VRz361&x1>=x16/y2=0/y1=1/v614>1:Sz130245;
!!VRz361&x1>=x16/y2=0/y1=2:Sz130246;
** end of function
[ 本帖最后由 wuxiangjinxing 于 2011-9-13 11:22 编辑 ] |
|