fizmo
unread,Apr 29, 2013, 5:51:10 AM4/29/13You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to
Hi all,
I would like to share the code of Sneaky B2 with you.
The self-replicating part of the code is typically found in paper warriors on the Low-Process (LP) hill.
The major difference is, that Sneaky B2 starts first with a bomb/scan loop of this type:
sGo add.f sTab, sScan
sScan mov.i }sOff1, sOff2
jmz.f -2, {sScan
If it founds something it dat-wipe the scanned location and at the same time it replicate itself to another location:
mov.i sTab, }sScan
mov <sStart, {to
jmn -2, sStart
at the end it starts the replicated code and also continue bomb/scan the core:
spl >sStart, }-200
to jmz sAwa, *0
That means in the beginning of the battle Sneaky B2 behaves much like a dwarf warrior. Whereas during the battle, when the core becomes more colored the self-replication/dat-wiping becomes predominant.
Sneaky B2 shows good scores against most scanner types with weaknesses against some oneshots. Also the scores against paper warriors and stone/imps are usually good. But it is vulnerable against stone/imps that use spl-bombs. That's why I believe that Monster_Human_Grunt and Monster_Alien_Grunt on the 94nop hill are such type of stone/imps ;-)
Here are the scores against optimax fsh94nop0.3 benchmark:
Type %W %L %T pts
------------------------------
cds: 47.6 44.5 7.9 150.7
clr: 33.7 57.3 9.0 110.1
scn: 51.8 46.3 1.9 157.2
pap: 30.8 22.2 47.0 139.4
pwi: 13.2 17.7 69.1 108.6
pws: 31.1 25.7 43.2 136.5
sai: 24.8 31.2 44.0 118.4
sbi: 25.5 27.9 46.6 123.1
stn: 42.0 51.8 6.2 132.3
The scores show, that Sneaky B2 is a surprisingly good allround warrior. I think it has potential for further improvements.
Sneaky B2 is currently 14th on the 94draft hill and appeared already on the 94nop and 94x hills.
Ok, without further ado here's Sneaky B2:
;redcode-94
;author Christian Schmidt
;name Sneaky B2
;strategy Self-Replicating Stone/scanner
;assert 1
;------------ Qscan Constant ---------------
zero equ qbomb
qtab3 equ qbomb
qz equ 2108
qy equ 243
qc2 equ ((1 + (qtab3-qptr)*qy) % CORESIZE)
qb1 equ ((1 + (qtab2-1-qptr)*qy) % CORESIZE)
qb2 equ ((1 + (qtab2-qptr)*qy) % CORESIZE)
qb3 equ ((1 + (qtab2+1-qptr)*qy) % CORESIZE)
qa1 equ ((1 + (qtab1-1-qptr)*qy) % CORESIZE)
qa2 equ ((1 + (qtab1-qptr)*qy) % CORESIZE)
qoff equ -88
qstep equ -7
qtime equ 20
;-------Constants for optimization----------
sLen equ 21
sOff1 equ 219
sOff2 equ 7771
sStep1 equ 3431
sStep2 equ 3916
sAwa equ 2543
pAwa equ 5895
;-------------------------------------------
dat 0, 0
qbomb dat >qoff, >qc2
;------ 45 instructions --------------------
pGo spl 1 , 0
for 5
mov.i <sTab+1, {pBoot
rof
pBoot djn zero+pAwa, #1
dat 0, 0
dat 0, 0
dat 0, 0
sStart mov #sLen, #sLen
sGo add.f sTab, sScan
sScan mov.i }sOff1, sOff2
jmz.f -2, {sScan
mov.i sTab, }sScan
mov <sStart, {to
jmn -2, sStart
spl >sStart, }-200
to jmz sAwa, *0
sTab dat <sStep1, >sStep2
for 25
dat 0, 0
rof
;-------------------------------------------
dat 0, <qb1
qtab2 dat 0, <qb2
dat 0, <qb3
dat 0, 0
dat 0, 0
dat 0, 0
dat 0, 0
dat zero-1, qa1
qtab1 dat zero-1, qa2
dat 0, 0
dat 0, 0
dat 0, 0
dat 0, 0
dat 0, 0
qgo sne qptr+qz*qc2, qptr+qz*qc2+qb2
seq <qtab3, qptr+qz*(qc2-1)+qb2
jmp q0, }q0
sne qptr+qz*qa2, qptr + qz*qa2 + qb2
seq <qtab1, qptr+qz*(qa2-1)+qb2
jmp q0, {q0
sne qptr+qz*qa1, qptr+qz*qa1+qb2
seq <(qtab1-1), qptr+qz*(qa1-1)+qb2
djn.a q0, {q0
sne qptr+qz*qb3, qptr+qz*qb3+qb3
seq <(qtab2+1), qptr+qz*(qb3-1)+(qb3-1)
jmp q0, }q1
sne qptr+qz*qb1, qptr+qz*qb1+qb1
seq <(qtab2-1), qptr+qz*(qb1-1)+(qb1-1)
jmp q0, {q1
sne qptr+qz*qb2, qptr+qz*qb2+qb2
seq <qtab2, qptr+qz*(qb2-1)+(qb2-1)
jmp q0, }4443 ;extra attack
seq >qptr, qptr+qz+(qb2-1)
jmp q2, <qptr
seq qptr+(qz+1)*(qc2-1),qptr+(qz+1)*(qc2-1)+(qb2-1)
jmp q0, }q0
seq qptr+(qz+1)*(qa2-1),qptr+(qz+1)*(qa2-1)+(qb2-1)
jmp q0, {q0
seq qptr+(qz+1)*(qa1-1),qptr+(qz+1)*(qa1-1)+(qb2-1)
djn.a q0, {q0
jmz.f pGo, qptr+(qz+1)*(qb2-1)+(qb2-1)
q0 mul.b *2, qptr
q2 sne {qtab1, @qptr
q1 add.b qtab2, qptr
mov qtab3, @qptr
qptr mov qbomb, }qz
sub #qstep, qptr
djn -3, #qtime
jmp pGo, }3256 ;extra attack
dat 0, 0
dat 0, 0
dat 0, 0
dat 0, 0
end qgo