Will 'Varfar's entries for Neogryzor's challenge #3

I am a big fan of Neogryzor's challenges. No. 3 (Lucky Strike) has been particulary involved for me.

The secret to my attack is timing; watch a cell for it to be placed by the imp; pause one cycle and then bomb one cell behind the cell you saw changed. This will always hit the tail. I discovered this by observation in Joonas's SDL port of Pmars in Windows, rather than studying the maths. I did try to study the spiral pattern mathematically, but it did my head in. Trial and error in pmars found me a cell that would always be executed, which also happened to be the 'tail'. Cool! After I developed my "Really Evil Bomb" Joonas told me of the very similiar "One True Imp Bomb". I experimented with both.

Having got them short (5 instructions), I started trying to get them fast. I managed to fit a 1.5c scanner and still make the 99% score threshold (just). At first I calculated the scores by running each warrior for 10,000 rounds against the spiral. I could then take the wins and slip a decimal point in there.. However, run those 10,000 rounds several times and you'll see the wins may vary by a fraction of a percent. I later discovered the -P option, giving much more accurate scoring. The times when my entries don't win is when an imp spiral arm is started right on or very close to the warrior. So the smaller the warrior the less this chance, and the higher the score. However, the 'size' of the warrior is not just strictly instructions; some of my warriors require 'whitespace' to kill the spiral as it dies, and this has to be included in their 'footprint'. Hence some of my 4-liners actually have larger footprints than my best 5-liner, and so actually score slightly worse.

Here are some entries I've developed:

WarriorScoreLengthSpeedBombNotes
;redcode-94
;name Lucky Strike
;author Will 'Varfar'
;strategy A simple 4 liner, which uses Mizcu's
;strategy fabulous boot idea,so that if it is going
;strategy to be hit midsection by an imp arm, it
;strategy boots so it is no longer affected; result?
;strategy 100% win assured (as the imp has a slower
;strategy boot)
;assert 1

step equ 2667
bdist equ (step/2)

;detect if going to get hit midsection
ring sne -step+safe,step+safe
jmp imp ; no risk, so no boot
boot mov @launch,{launch
djn boot, launch
launch jmp bdist, fall
;wait for enemy
imp jmp imp
;enemy imp can't follow
jmz.a fall, }safe
;throw one bomb once
attack mov.i #1, <1
;and wait for imp to die
safe jmp #-1, imp
fall end
100%9-One True Imp BombThis is my favourite bomber attached to a boot strategy by Mizcu, which avoids being trampled by an imp arm and produces a perfect score. Wish I'd thought of this myself :-D
;wait for enemy
imp jmp imp
;enemy imp can't follow
jmz.a fall, }safe
;throw one bomb once
attack mov.i #1, <1
;and wait for imp to die
safe jmp #-1, imp
fall end
99.85%4-One True Imp BombThis has a footprint of 6. Actually, there are several ways to make that spare timing NOP into a 'filter' (a branch that enemy processes cannot follow; we don't want enemy imp processes entering our wimp!). But this one is quite elegent so I show it here, as it takes advantage of the fact that the imp has a 0 in the a-field (think what happens if the imp arm starts at fall+1).
        step    equ     2667
imp equ (wait-3)
;wait for enemy
wait jmz #wait, imp
nop #0
;throw one bomb once
attack mov.i #0, <1
; and wait for imp to die
safe jmp #safe, imp
end
99.77%4-One True Imp BombCan it be shorter than this? Note that it looks ahead of itself; it relies on the dats between itself and the imp to kill the imp processes as they run off the end
        step    equ     2667
;wait for enemy
wait jmp wait
nop 0
;throw one bomb once
attack mov.i #0, <1
; and wait for imp to die
jmp }safe, wait
safe jmp #0
end

99.82%5-One True Imp BombCan it score better than this? Look at how it jumps to safety in a way that can't be followed by the imp processes, so they run off the end
        step    equ     2667
;wait for enemy
imp
wait jmp wait
nop 0
;throw one bomb once
attack mov bomb, imp-1
; and wait for imp to die
jmp }safety
; how dirty is this???
bomb mov -imp+1, >step
safety jmp #safety
end
99.79%6-Really Evil Bomb-
        step    equ     2667
imp equ (scan-2)
;wait for enemy
scan jmz scan, imp
nop 0
;throw one bomb once
attack mov bomb, imp-1
; and wait for imp to die
wait jmp wait
; how dirty is this???
bomb mov -imp+1, >step
end
99.74%5-Really Evil Bomb-
        step    equ     2667
imp equ (scan-step+1)

;scan for enemy 1c
scan jmz scan, <ptr
;adjust
add #3, ptr
;sync with enemy
timing jmz timing, @ptr
sub.ba ptr, bomb
;throw one bomb once
attack mov bomb, <ptr
; and wait for imp to die
ptr jmp 0, imp
; how dirty is this???
bomb mov 2, >step
end
99.28%71cReally Evil BombAfter scanning, it needs to resync to find the tail; this eats valuable core cells, making it more vunerable to being started on
        step    equ     2667
imp equ (scan-step+1)

;scan for enemy 1.5c
scan sne.ba <ptr, <ptr
jmz scan, <ptr
;adjust
add #3, ptr
;sync with enemy
timing jmz timing, @ptr
sub.ba ptr, bomb
;throw one bomb once
attack mov bomb, <ptr
; and wait for imp to die
ptr jmp 0, imp
; how dirty is this???
bomb mov 2, >step
end
98.96%81.5cReally Evil Bomb-
        step    equ     2667
imp equ (scan-step)

;scan for enemy 1.5c
scan sne.ab <ptr, <ptr
jmz scan, <ptr
;sync with enemy
add #3, ptr
wait jmz #wait, @ptr
nop #0
;throw one bomb once
attack mov.i #0, <1
; and wait for imp to die
ptr
safe jmp #safe, imp
end
99.09%71.5cOne True Imp bomb-

What does it show? It shows that the "One True Imp Bomb" is better than my "Really Evil Bomb" because it can throw itself into the enemy, which saves one instruction. But I still like my Really Evil Bomb because I think I discovered it

Thanks to John M and Joonas for helping me on this, and for German for setting such good challenges!!