;redcode-94 ;name P^2 ;author Anders Rosendal ;Above line was originally ;author Anton Marsden ;Changed by Philip Kendall ;assert CORESIZE==8000 PSTATE EQU 666 ; pspace location containing current state STATES EQU 6 ; maximum number of states (for brainwash protection) ;NOTE: state values go from 0 to STATES-1 dat 0,init_state-state in dat 0,loss_table-state dat 0,win_table-state dat 0,tie_table-state think ldp.a #0,in ; get input value load ldp.a #PSTATE,state ; load old state mod.a #STATES,state ; brainwash protection add.ba *in,state ; select correct state table store stp.a *state,load ; store new state state jmp @0 ; jump to warrior code ; You could also delete the #PSTATE value ; if you wish (or the stp.a instruction). c1 EQU ptr1 c2 EQU boot loss_table dat 1,c1 dat 2,c1 dat 3,c2 dat 4,c2 dat 5,c2 dat 0,c1 win_table dat 0,c1 dat 0,c1 dat 0,c1 dat 3,c2 dat 3,c2 dat 3,c2 tie_table dat 0,c1 dat 0,c1 init_state dat 0,c1 dat 3,c2 dat 3,c2 dat 3,c2 ;---------------------------------------- space equ (MINDISTANCE) djnptr EQU 60 step EQU 1272 ;mod-8 ca boot2 z for 19 mov.i {bsource2,ptr1 ; and use the decrement in the b-field mov *ptr1, >ptr1 ; and use the decrement in the b-field mov *ptr1, >ptr1 ; and use the decrement in the b-field snoop djn.F loop2, 0,4000 dat 0,0 start spl #0,>ptr mov.i bomb,>ptr djn.f -1,>ptr bomb dat >2667,bomb-ptr+last+1 start2 spl #0,>ptr mov.i bomb,>ptr djn.f -1,>ptr for 0 start3 spl #0,>ptr mov.i bomb,>ptr djn.f -1,>ptr rof last bsource dat 0,0 boot z for 9+0 mov.i {bsource,