Sections
Home
Hills
Infinite Hills
Tournaments
Software
Evolving
Optimizer
Community
Newsletter
Discussion
History
Sections
 
For Beginners
First Steps
FAQ
Guides
Lexicon
Benchmarks
For Beginners
> Home > The Corewar Lexicon > c - speed of light

c - speed of light


Whenever you found a number or a fraction followed by the letter c in a strategy line of a warrior, it has something to do with the speed of the warrior or a part of the warrior.

The most simple explaination for c is one action per cycle. Imp move's one instructions forward each cycles, so his speed is c.

To decribe the speed of a stone you must include some instructions more then the bombing mov-instruction. You must cover the whole loop for the correct speed of that stone. Look at this simple stone.
loop    mov.i   bomb,   -1
        add.ab  #4,  -1
        jmp     loop
bomb    dat     0   ,   0
The loop ist formed by mov/add/jmp, but only the mov does the bombing. To c alculate the speed of the stone you say - "one bomb per three instructions" The bombing speed of that stone is 0.33c.

A litte tweak to this stone can increase it's speed.
loop    mov.i   bomb,   @1
        mov.i   bomb,   @-2
        add.ab  #10,    -1
        jmp     loop
bomb    dat     0,      5
So two bombs per four instructions - 0.5c.

On jmz-scanner you can work on the same way.
loop    add.ab  #10,    1
        jmz.f   loop,   8
        ( attack code )
One scan per two instructions - 0.5c

When you working with sne/seq-scanner you will face the fact that it is possible to be faster than c. The instructions seq and sne are comparing two corecells to each other, two scans in one instruction. For calculate the speed you must focus the whole loop too.
inkr    dat.f   step,   step
ptr     dat.f   posa,   posb
loop    add.f   inkr,   ptr
        sne.i   *ptr,   @ptr
        add.f   inkr,   ptr
        sne.i   *ptr,   @ptr
        jmp     loop
        ( attack code )
The loop is formed by add/sne/add/sne/jmp - means four scans per five instructions - 0.8c

Sometimes you want to describe only one aspect of your warrior. Look at this extended 0.5c stone.
loop    mov.i   bomb,   @1
        mov.i   bomb,   @-2
        add.ab  #10,    -1
        jmp     loop,   <-10    ; imp-gate
bomb    dat     0,      5
I have added an partial imp-gate to the b-field of the jmp-instruction. This gate works one decrement per four instructions - 0.25c. So this stone can be described by 0.5c stone with 0.25c imp gate

There are different forms of decoymaker where the speed is part of the name. Here is one of them, the 3c decoymaker.
tDecoy    equ    (tWipe+1-1196)
tStart    mov    <tDecoy+0,{tDecoy+2     ; make a quick-decoy
          mov    <tDecoy+3,{tDecoy+5     ; to foil one-shots
          mov    <tDecoy+6,{tDecoy+8     ; and the occasional q-scan
          djn.f  tScan+1  ,<tDecoy+10

( taken from the famous scanner "He scans alone" )
There is no loop, because the djn is only the jump to the main-scan loop. When you calculate you get the balance of the whole code fragment, which is 3c.

The c notation can also be used on bombs. Dat instructions used as bombs can't be executed - really ? There is an execution, the process dies, but predecrements or postincrements will be done. This anti-imp datbomb
dat <2667,  <5334
does two decrements and one process dies - three actions per one cycle, a 3c dat bomb.

In theory, a mod.x }2667,}5334 placed in one of the arms of an a-driven imp ring does 4 actions: 2 postinkrements, 1 b-field changes to zero and the executing process dies because of "division by zero" - a 4c anti-a-imp-bomb.

© 2002-2005 corewar.info. Logo © C. Schmidt
Main Articles

Paper

QScan

Scanner

Main Articles