Subject: [beginner] Imp Craze 91.43 Date: Sat Oct 28 1995 From: Planar Introduction. ------------- Old-timers need not read this article. This is intended for beginners who, like me, have a hard time understanding all the subtleties of the warriors that get posted in this newsgroup. This is essentially an account on how I managed to get my first warrior on the beginner hill. Most basic warriors are easy to understand in principle, but with a lot if intricate details in the implementation. The imp spiral is the exception: based on a very clever idea, its implementations are not too hard to understand. That's why it's a good start for a beginner. Imp spirals. ------------ I started with the FAQ sections on launching imp-spirals: binary launch, spl-add launch and vector launch. The vector launch is the first one I could make sense of. If you're a beginner, I suggest that you look up the code in the FAQ and work out the precise execution order of all the instructions, how they get pushed into the process queue, etc. (This is exercise 1. I suggest using cdb. It's never too early to learn cdb.) Then choose a size for your imp spiral. The number of points of a spiral must be a divisor of coresize+1. For coresize = 8000, this means all numbers except multiples of 2 or 5. This is a table of imp sizes with the corresponding step size: 3,2667 7,1143 9, 889 11,5091 13,3077 17,2353 19,7579 21, 381 23,2087 27,2963 29,6069 31,3871 33,1697 37,4973 39,6359 41,1561 43,3907 47,2383 49,2449 51,3451 53,2717 57,5193 59,4339 61,3541 63, 127 67,7403 69,6029 71,3831 73,6137 77,3013 79,1519 81,6321 83,6747 87,2023 89, 809 91,5011 93,3957 97,6433 99,5899 Using a huge spiral size is interesting because it makes scanners do useless work: one turn of your spiral will modify a lot of core locations, only one of which is vulnerable to attack. This is exactly what I did with Imp Craze. A simple vector launch will use 9 instructions to build up the processes, so the vector can be 91 instructions. A 91-process spiral can have up to 91 points. But a 91-process 91-point spiral is a ring. It is too easy to kill: if one process gets killed, the entire ring will collapse. I chose 43 points as a middle ground, and here is Imp Craze 91.43 as submitted to the beginner hill: ;redcode-b ;name Imp Craze 91.43 ;author Planar ;strategy imp spiral: vector-launched, 43-point, 91-process ;assert CORESIZE==8000 threads equ 91 step equ 3907 org start start spl 1, <-1000 mov.i -1, #1 spl 1, <-2000 spl 1, <-1500 mov.i -1, #1 spl 1, <-2500 spl 1, <-3000 djn.a @vector, #1 imp mov.i #1, step i for threads dat #0, #imp+(threads-i)*step rof vector equ imp+threads end You can convert it into Imp Craze 91.x by just changing the "step" to the step size corresponding to x processes. As a second exercise for beginners, I suggest building a 180-process launcher by using T. Hsu's method of storing two pointers in each vector element. You'll find an example of this in the code for juliet storm (see the second issue of Core Warrior). Notice that having a huge launching code that takes a lot of time (about 100 cycles) to work is not such a bad thing. As soon as 43 processes are launched, the imp spiral will live, even if the launcher is clobbered by the enemy. As a third exercise, try other values (bigger and smaller than 43) and see how they fare against various opponents. Scanners are especially hard on Imp Craze. Notice that, if you use too small a value, then Imp Craze will not cover the whole core because the spiral advances too slowly, and you lose some victories against the warriors that have few processes (such warriors will die when overrun by a spiral). A fourth exercise would be to think about what happens when two spirals of different sizes fight each other. And do some experiments, of course. Tactical considerations. ------------------------ The beginner hill currently contains (the classification is approximative): 6 stones (juliet storm, Mythicon, Weasel, Skimmer, Banzaiv1.2, Banzaiv1.3) 5 scanners (Hint Test, Heatseek2, Searching, 1stscanner, PlinyScan) 2 vampires (Web, Eradu) 1 paper (Paper6) 3 imps (Impfinity v1, Cyclone, Imp Craze 91.43) 1 paper-stone combination (P_Banzai) 1 mysterious program (Test-Fc) The stones are generally coupled with spirals (and spirals with stones) and the scanners and vampires often use a core-clear. My first attempts at getting on the hill were with a vampire. Not a good idea. To get on the hill, the best tactic is to find out what the trend is, and get one step ahead: write the natural predator of what is currently the majority on the hill: papers kill stones stones kill scanners and vampires (aka scissors) scanners and vampires kill papers imps tie a lot especially against papers. With all the stones currently on the hill, a paper should do well (as Paper6 shows) especially if vampire-resistant. You could also write a stone to feed on the scanners and vampires (this would help Paper6 get closer to juliet storm). Of course, if everybody starts submitting huge spirals to the hill, it will become a good idea to work on an imp-killer. Imp Craze results. ------------------ opponent W / L / T juliet storm 0 / 59 / 191 Heatseek2 85 / 117 / 48 ShadowImp 0 / 10 / 240 Test-Fc 60 / 123 / 67 Web 75 / 171 / 4 Weasel 60 / 77 / 113 Cyclone 28 / 25 / 197 Obvious 168 / 32 / 50 Mythicon v1.1a 127 / 66 / 57 Eradu 102 / 49 / 99 Skimmer 110 / 68 / 72 Cotton-DH 8a 0 / 26 / 224 PlinyScan 176 / 26 / 48 DeathWalker 24 / 13 / 213 Banzai0.2 219 / 17 / 14 Enlightenment II 115 / 10 / 125 Apple attack 84 / 73 / 93 Mokkori v0.2 1 / 72 / 177 Chunky 2 80 / 6 / 164 Imp Craze 91.43 5 / 5 / 240 Impfinity v1 1 / 27 / 222 Recon v2.5 149 / 89 / 12 1stscanner 35 / 90 / 125 Bomber 186 / 23 / 41 PaIR 0 / 1 / 249 Eradu v1.01 107 / 48 / 95 Ferret 49 / 47 / 154 Scanner 202 / 11 / 37 Searching 46 / 97 / 107 Paper6 0 / 68 / 182 Banzaiv1.2 26 / 52 / 172 Banzaiv1.3 4 / 43 / 203 P_Banzai 0 / 10 / 240 References. ----------- The FAQ is at You'll find back issues of Core Warrior, and a library of warriors, at -- Planar