;redcode-94nop ;name Macro Magic ;author John Metcalf ;strategy scanner ;assert CORESIZE == 8000 org qscan step equ 4961 hit equ 3 ; location of the final scan (first line is 0) invis equ 5 ; location of invisible instruction length equ 9 ; length of scanner ; -------------------------------------- ; calculate # of scans before self-scan ; -------------------------------------- for CORESIZE+!(f=1)*(h=hit) for !t=t+(f=f*((h=(h+step)%CORESIZE)>=length||h==invis)) rof rof time equ t first equ (hit+attack+step*time) ; -------------------------------------- warr equ scan+1 gate equ scan attack mov *sbmb, >scan mov jbmb, @scan scan sub #step, #first jbmb jmz.f scan, @scan ; hit djn @0, @attack sbmb spl #0, 0 ; invis clear mov dbmb, >gate djn.f clear, >gate dbmb dat <1, 3-gate for 61 dat 0,0 rof qfac equ 1111 power equ 3199 ; -------------------------------------- ; calculate power using the binary method ; -------------------------------------- ; qdec equ qfac^power for 20+!(r=1)*(x=qfac)*(n=power) for n%2 for !r=(r*x)%CORESIZE rof rof for !x=(x*x)%CORESIZE+!n=n/2 rof rof qdec equ (r+1) ; -------------------------------------- qa equ (qfac*(qtab0-1-qptr)+1) qb equ (qfac*(qtab0-qptr)+1) qc equ (qfac*(qtab1-1-qptr)+1) qd equ (qfac*(qtab1-qptr)+1) qe equ (qfac*(qtab1+1-qptr)+1) qf equ (qfac*(qtab2-qptr)+1) qtime equ 18 qstep equ -7 qgap equ 87 qdecode mul.b *q1, qptr q0 sne