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:
| Warrior | Score | Length | Speed | Bomb | Notes |
|---|---|---|---|---|---|
;redcode-94 |
100% | 9 | - | One True Imp Bomb | This 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 |
99.85% | 4 | - | One True Imp Bomb | This 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 |
99.77% | 4 | - | One True Imp Bomb | Can 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 |
99.82% | 5 | - | One True Imp Bomb | Can 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 |
99.79% | 6 | - | Really Evil Bomb | - |
step equ 2667 |
99.74% | 5 | - | Really Evil Bomb | - |
step equ 2667 |
99.28% | 7 | 1c | Really Evil Bomb | After 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 |
98.96% | 8 | 1.5c | Really Evil Bomb | - |
step equ 2667 |
99.09% | 7 | 1.5c | One 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!!