In preparation for my evolving challange at latest and very exciting round of the corewars tournament, I have been gathering some stuff together.

- candidate warriors are warriors that my scripts have found on the Koenigstuhl hills which are short enough to fight (and therefore be a test for my evolving warriors)
- I also worked out the number of unique combinations of warrior that was in eight instructions. My working is below:

How many combinations of warrior can you have in just eight instructions? Well, lets work out how many combinations of opcodes, modifiers and addressing modes there are in a single instruction first:

- Multi maniac has some unique conditions. There is no SPL instruction.
- Therefore, there are 18 instructions, 7 modifiers, 8 addressing modes for the a operand and 8 addressing modes for the b operand.
- So there are 18*7*8*8 combinations of opcode, modifier and addressing modes; that is 8064 combinations.
- However, not all combinations of opcode and modifier make sense. Some combinations of opcode/modifier don't affect one or more operands (but if the operand is a pre-decrement or post-increment, it still has to be evaluated). Trust me, the real number is approximately 6000 odd. I have a lookup table that gets this number exact. Thing is, I guessed that only 4000 would make sense, and I used the approximation in my maths below; the idea that there is actually more obscure combinations possible would make the results below even more
*staggering* - Ok, so there is approximately 4000 codes possible in an instruction. There is also the value of the operands to consider. In the Multi-maniac tournament, the core-size is 8000. With both operands, there are therefore 4000*8000*8000 combinations per instruction. That is 256000000000.
- Now it is worth stressing at this point that my 4000 approximation is convienient yet shoddy. There are approximately a little over 4000 executable combinations in corewars, without SPL nor pspace. Other combinations are aliased to one of these instructions: for example, SPL.AB is treated as SPL.F by the MARS. However, to the SEQ.I and SNE.I instructions, SPL.AB and SPL.F are still quite different! So, maybe, I ought to be counting the full 8064 combinations after all.. aghhh, my head is hurting!

And the answer is:

**147573952589676412928000000000000000000000000000000000000000000000000000000000000000000000000**

Just for fun I recalculated with the full 8064 combinations: `40265577447197132975488474761776769470130290688000000000000000000000000000000000000000000000000`

If you spot any major flaws, or just want to chat about corewars and MARs, you can contact me! "varfar at yahoo dot co (and dot the country code for Britain)".