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 Newsletters > Core Warrior > Issue #1

Issue 57                                                     30 March, 1997
______________________________________________________________________________
Core Warrior is a weekly newsletter promoting the game of corewar.  Emphasis
is placed on the most active hills--currently the '94 draft hill and the
beginner hill.  Coverage will follow where ever the action is.  If you have
no clue what I'm talking about then check out these five-star internet locals
for more information:

FAQs are available by anonymous FTP from rtfm.mit.edu as
pub/usenet/news.answers/games/corewar-faq.Z
FTP site is: ftp.csua.berkeley.edu /pub/corewar
Web pages are at: (Please note new Stormking's address)
http://www.koth.org/                            ;Stormking
http://www.ecst.csuchico.edu/~pizza/koth        ;Pizza
http://pauillac.inria.fr/~doligez/corewar/      ;Planar

Newbies should check the stormking page for the FAQ, language specification,
guides, and tutorials.  Post questions to rec.games.corewar.  All new players
are infinitely welcome!

If ftp.csua.berkeley.edu is unreachable, you can download pMARS at:
Terry's web page--http://www.infi.net/~wtnewton/corewar/
Planar ftp site--ftp://ftp.inria.fr/INRIA/Projects/para/doligez/cw/pmars
Fechter ftp site--ftp://members.aol.com/ofechner/corewar

A collection of Bezzi's hints in the first issues is available at:
ftp://ftp.volftp.vol.it/pub/pc/msdos/games/solutions/bbhints.zip

Beppe Bezzi web page - http://www.aspide.it/freeweb/Bezzi
______________________________________________________________________________
Greetings.

Aging is slow on the pizza hills these days, but traffic is heavier than the
change in age implies.  There have been over 430 mailings to the pizza hills
in the last 30 days, most of the submissions going to the limited process
hill.  The beginner's hill had the next highest number of submissions with
the '94 hill relatively quiet.  You can find all theses usage statistics
in a relatively new addition to the pizza homepage.  Very nice.

Philip Kendall has been kind enough to provide us with this issues hint on
pspace brains.

--M R Bremer
______________________________________________________________________________
Current Status of the Internet Pizza Server ICWS '94 Draft Hill:

Hill Specs:
   coresize: 8000
   max. processes: 8000
   duration: after 80,000 cycles, a tie is declared.
   max. entry length: 100
   minimum distance: 100
   rounds fought: 200
   instruction set: ICWS '94 Draft

Last challenge: Fri Mar 21 06:54:21 PST 1997
 #   %W /  %L /  %T                       Name               Author Score  Age
 1  44.7/ 36.6/ 18.7            The Bloodhound           Ian Sutton 152.8   10
 2  38.1/ 27.2/ 34.6              Head or Tail    Christian Schmidt 149.0   26
 3  40.9/ 35.7/ 23.4                Tides v0.1          Ian Oversby 146.1   22
 4  33.8/ 21.8/ 44.3                    RetroQ              P.Kline 145.9   38
 5  36.5/ 27.5/ 36.0            Nine Seven Six           M R Bremer 145.5  102
 6  34.7/ 24.0/ 41.2                    Gigolo   Core Warrior staff 145.5  292
 7  30.8/ 16.2/ 53.0      Return Of The Jedimp             John K W 145.5  238
 8  41.5/ 37.9/ 20.6              Solomon v0.8          Ian Oversby 145.1   84
 9  37.7/ 31.0/ 31.3                Quimp v0.2          Ian Oversby 144.4    6
10  41.1/ 39.0/ 19.9                NCC-1701-A       Philip Kendall 143.1   41
11  41.1/ 39.7/ 19.2               The Machine        Anton Marsden 142.4  144
12  32.7/ 23.4/ 43.9           unrequited love                kafka 142.1  336
13  44.3/ 47.7/  8.0            He Scans Alone              P.Kline 141.0   53
14  29.6/ 18.8/ 51.6               Impish v0.2          Ian Oversby 140.5  277
15  40.4/ 41.1/ 18.6                     Blain                Nimon 139.7    4
16  38.9/ 38.3/ 22.7       Damage Incorporated        Anton Marsden 139.5  279
17  39.2/ 39.0/ 21.8           Ace of Spades 2    Christian Schmidt 139.4    3
18  38.7/ 38.5/ 22.7              Scanitator 5    Christian Schmidt 138.9    3
19  29.9/ 21.3/ 48.8                 Trident^2             John K W 138.5  168
20  37.5/ 39.8/ 22.7              More testing                 Thos 135.3    3
21  27.7/ 21.7/ 50.6           blue spark 0.04       bjoern guenzel 133.8   18
22  37.5/ 41.2/ 21.3         One Man Army v1.0           Ian Sutton 133.7    2
23  33.1/ 33.5/ 33.4         Fast Fast Fast v2                Franz 132.7   52
24  39.3/ 46.7/ 14.0              Instant Ogre                Edgar 132.0    1
25  32.4/ 34.8/ 32.8              Instant Ogre                Edgar 130.1   21

Monthly age: 12 this month ( 13 last issue, 9 the issue before )
New warriors:   Turnover/age rate %
Average age: 88 ( 93 last issue, 119 the issue before )
Average score: 141 ( 135 last issue, 134 the issue before )
The top 25 warriors are represented by 14 independent authors: Oversby with
4; Schmidt with 3; Sutton, Kline, JKW, Marsden and Edgar with 2. All others
with one warrior each.

______________________________________________________________________________
94 - What's New

 #   %W /  %L /  %T                       Name               Author Score  Age
 1  44.7/ 36.6/ 18.7            The Bloodhound           Ian Sutton 152.8   10
 9  37.7/ 31.0/ 31.3                Quimp v0.2          Ian Oversby 144.4    6
15  40.4/ 41.1/ 18.6                     Blain                Nimon 139.7    4
17  39.2/ 39.0/ 21.8           Ace of Spades 2    Christian Schmidt 139.4    3
18  38.7/ 38.5/ 22.7              Scanitator 5    Christian Schmidt 138.9    3
20  37.5/ 39.8/ 22.7              More testing                 Thos 135.3    3
22  37.5/ 41.2/ 21.3         One Man Army v1.0           Ian Sutton 133.7    2
24  39.3/ 46.7/ 14.0              Instant Ogre                Edgar 132.0    1

Bloodhound vaults onto the scene.
______________________________________________________________________________
94 - What's No More

 #   %W /  %L /  %T                       Name               Author Score  Age
26   1.3/  1.9/  0.9             QFalcon (vii)          Ian Oversby   4.6   23
26  26.6/ 29.4/ 44.1              Terkonit 0.4    Christian Schmidt 123.8   43
26  30.7/ 41.6/ 27.8              Scanitator 4    Christian Schmidt 119.7   37
26  33.0/ 43.2/ 23.8              Instant Wolf                Edgar 122.8   57
26  38.2/ 50.8/ 10.9                  Memories               Beppe  125.6  152
26  34.4/ 47.1/ 18.4                  Oblivion           Ian Sutton 121.7   99
26  27.9/ 35.1/ 37.0                  Dust 7.0           Justin Kao 120.6    6
26   2.2/  0.6/  1.2                    Test I          Ian Oversby   7.8    3

Bezzi's well known Memories falls.  QFalcon was killed by its author and
replaced by the successful Quimp.  Oblivion falls just short of the New Hall
of Fame.
______________________________________________________________________________
94 - What's Old

 #   %W /  %L /  %T                       Name               Author Score  Age
12  32.7/ 23.4/ 43.9           unrequited love                kafka 142.1  336
 6  34.7/ 24.0/ 41.2                    Gigolo   Core Warrior staff 145.5  292
16  38.9/ 38.3/ 22.7       Damage Incorporated        Anton Marsden 139.5  279
14  29.6/ 18.8/ 51.6               Impish v0.2          Ian Oversby 140.5  277
 7  30.8/ 16.2/ 53.0      Return Of The Jedimp             John K W 145.5  238
______________________________________________________________________________
OLD HALL OF FAME
* means the warrior is still active.

Pos    Name                  Author          Age     Strategy
 1  Thermite II            Robert Macrae     2262    Qscan -> bomber
 2  Impfinity v4g1         Planar            1993    Stone/ imp
 3  Jack in the box        Beppe Bezzi       1620    P-warrior
 4  Tornado 3.0            Beppe Bezzi       1567    Bomber
 5  Torch t18              P.Kline           1539    Bomber
 6  Chameleon              Myer R Bremer     1437    P-warrior
 7  Frontwards v2          Steven Morrell    1420    One shot scanner
 8  Evol Cap 6.6           John Wilkinson    1299    Imp / stone
 9  quiz                   Schitzo           1262    Scanner/ bomber
10  T.N.T.                 Maurizio Vittuari 1204    Bomber
11  Grilled Octopus v0.5   David Boeren      1154    P-warrior
12  Hazy Shade II          John Wilkinson    1102    P-warrior
13  Stepping Stone         Kurt Franke       1049    Qscan -> Vampire
14  Rosebud                Beppe Bezzi        993    Stone/ imp
15  Iron Gate 1.5          Wayne Sheppard     926    CMP scanner
16  T.N.T. pro             Maurizio Vittuari  925    Bomber
17  Agony II               Stefan Strack      912    CMP scanner
18  Barrage                Anton Marsden      876    Qscan -> replicator
19  Blue Funk              Steven Morrell     869    Stone/ imp
20  Flurry                 Anton Marsden      835    Qscan -> pwarrior
21  Thermite 1.0           Robert Macrae      802    Qscan -> bomber
22  Blue Funk 3            Steven Morrell     766    Stone/ imp
23  Night Train            Karl Lewin         755    Replicator
24  Mirage 1.5             Anton Marsden      736    Scanner/ bomber
25  Blizzard               Anton Marsden      713    Qscan -> replicator
______________________________________________________________________________
NEW HALL OF FAME
* means the warrior is still active.

Pos    Name                  Author          Age     Strategy
 1  Probe                  Anton Marsden      403    Q^2 -> Bomber
 2  Blur 2                 Anton Marsden      396    Scanner
 3  unrequited love        kafka              336 *  Stone/ imp
 4  Gigolo                 Core Warrior staff 292 *  Q^2 -> Stone/ imp
 5  Damage Incorporated    Anton Marsden      279 *  Q^2 -> Bomber
 6  Impish v0.2            Ian Oversby        277 *  Stone/ imp
 7  Falcon v0.3            Ian Oversby        275    P-warrior
 8  Return Of The Jedimp   John K W           238 *  Q^2 -> Stone/ imp
 9  Rosebud                Beppe              218    Stone/ imp
10  Q^2 Miro               Anders Ivner       214    Q^2 -> Scanner/ bomber
11  Instant Wolf 3.4       Edgar              205    P-warrior
12  Goldfinch              P.Kline            201    P-warrior
13  Simple v0.4b           Ian Oversby        197    Stone/ imp
14  ompega                 Steven Morrell     189    Stone/ imp
15  Frogz                  Franz              172    Paper
16  Trident^2              John K W           168 *  Stone/ imp
17  Memories               Beppe              152    Scanner
18  The Machine            Anton Marsden      144 *  Scanner
19  Tiberius 3.1           Franz              130    P-warrior
20  CC Paper 3.3           Franz              107    Paper
21  mrb-test               m r bremer         106    ?
22  T.N.T. pro             Maurizio Vittuari  105    Bomber
23  Nine Seven Six         M R Bremer         102 *  Q^2 -> Stone / imp
24  Jack in the box II     Beppe Bezzi        100    P-warrior

Nine Seven Six enter the hall while Bezzi's Memories ends its run.
______________________________________________________________________________
Current Status of the Internet Pizza Server Beginner's Hill:

Hill Specs:
         coresize: 8000
   max. processes: 8000
         duration: after 80,000 cycles, a tie is declared.
max. entry length: 100
 minimum distance: 100
      maximum age: At age 100, warriors are retired.
    rounds fought: 200
  instruction set: ICWS '94 Draft

Last challenge: Sun Mar 30 11:23:28 PST 1997
 #   %W /  %L /  %T                       Name               Author Score  Age
 1  51.4/ 38.5/ 10.1             Pentagram 2.a            J.A.Denny 164.4   40
 2  47.2/ 34.7/ 18.1                  Hexagram            J.A.Denny 159.8   38
 3  47.4/ 43.6/  9.0            Scankiller 0.1    Christian Schmidt 151.3   50
 4  46.0/ 41.2/ 12.8            Flamberge 13.4        Matt Lewinski 150.7   88
 5  37.6/ 24.7/ 37.7                  Dust 7.0           Justin Kao 150.5   18
 6  46.8/ 43.4/  9.9   The Stainless Steel Rat    Christian Schmidt 150.2   61
 7  41.0/ 32.0/ 27.0               Flimsy v0.6          Ian Oversby 149.9   39
 8  38.6/ 27.4/ 34.1            Scanitator 3.0    Christian Schmidt 149.7   45
 9  45.8/ 42.0/ 12.2      Mostly Harmless v1.1           Justin Kao 149.5   69
10  43.3/ 37.8/ 18.9       Vivid Radiation 2.0        Matt Lewinski 148.7   87
11  44.8/ 41.6/ 13.5             Short Sword 4            JS Pulido 148.1   20
12  40.5/ 33.5/ 26.0           Versatility 1.7   Ross Morgan-Linial 147.5   66
13  38.2/ 30.5/ 31.2                    Zorm-B            Anonymous 145.9   23
14  45.1/ 46.9/  8.0             qDeath v .069         Ryan Coleman 143.3    3
15  42.3/ 44.2/ 13.5             Dwa Michaly b    Waldemar Bartolik 140.3   26
16  28.8/ 17.9/ 53.3                DemonSpawn            J.A.Denny 139.7   48
17  35.3/ 32.6/ 32.0                Apocalypse        Matt Lewinski 138.1   96
18  29.7/ 23.2/ 47.1                   Quantum    Christian Schmidt 136.2   42
19  31.6/ 29.8/ 38.6                 Heartworm                Edgar 133.3   36
20  30.2/ 31.3/ 38.4          Kohonenian Dream     Robert J. Street 129.1   12
21  31.7/ 35.2/ 33.1          Kohonenian Dream     Robert J. Street 128.3   11
22  33.6/ 41.7/ 24.7              Time Lag 1c3       Ilmari Karonen 125.4   22
23  31.1/ 39.5/ 29.4 Five-Finger Discount From         Ryan Coleman 122.8    2
24  33.8/ 46.1/ 20.1 Five-Finger Discount From         Ryan Coleman 121.5    8
25  34.3/ 52.4/ 13.3 Five-Finger Discount From         Ryan Coleman 116.1    1

Top 25 Averages:
    39.0/ 36.5/ 24.5                                                141.6   38
______________________________________________________________________________
Current Status of the Internet Pizza Server Limited Process Hill:

Hill Specs:
         coresize: 8000
   max. processes: 8
         duration: after 80,000 cycles, a tie is declared.
max. entry length: 200
 minimum distance: 200
    rounds fought: 200
  instruction set: ICWS '94 Draft

Last challenge: Fri Mar 28 21:18:16 PST 1997
 #   %W /  %L /  %T                       Name               Author Score  Age
 1  60.0/ 29.2/ 10.7     Limb Rending Incisors           Ian Sutton 190.8    5
 2  55.1/ 34.7/ 10.3           Solomon LP v0.1          Ian Oversby 175.4    2
 3  50.2/ 33.0/ 16.8                     Flips           Zul Nadzri 167.4    6
 4  45.8/ 24.3/ 29.9           Indecisive v0.1          Ian Oversby 167.4   11
 5  46.3/ 31.9/ 21.8              Bolder v0.01          Ian Oversby 160.7   10
 6  49.0/ 37.5/ 13.5           Romulan Warbird       Philip Kendall 160.5   15
 7  45.0/ 30.6/ 24.4                Twin Flame          Ian Oversby 159.4   36
 8  43.0/ 28.0/ 28.9             Paper 'LP' II       Philip Kendall 158.1   32
 9  41.0/ 27.7/ 31.3             Benchmark 1.0           Zul Nadzri 154.3   30
10  42.3/ 36.8/ 21.0             Bag of Tricks        Anton Marsden 147.8   20
11  41.5/ 35.8/ 22.7                red marble       bjoern guenzel 147.2   25
12  40.7/ 35.7/ 23.5                 Romantica           Zul Nadzri 145.8    3
13  39.3/ 36.5/ 24.2               Inferno 1.8       Philip Kendall 142.2   52
14  41.8/ 41.3/ 16.9                   red eye       bjoern guenzel 142.2   26
15  34.1/ 26.3/ 39.6                Paper 'LP'       Philip Kendall 141.9   53
16  36.0/ 33.8/ 30.2                Iocane 0.0             John K W 138.2   19
17  36.5/ 38.4/ 25.1                  oldtimer       bjoern guenzel 134.6   38
18  35.0/ 40.4/ 24.6                rimmer 2.0                  jkw 129.6   44
19  37.0/ 45.6/ 17.4 Hopefully Indestructible            Ian Sutton 128.5   24
20  37.0/ 46.6/ 16.4                Juggernaut        Anton Marsden 127.4   29
21  33.7/ 45.1/ 21.2               Dr. Gate v4                Franz 122.3   40
22  31.0/ 46.1/ 22.9                  Dr. Gate                Franz 115.9   42
23  21.5/ 33.9/ 44.6 Completely Indestructible           Ian Sutton 109.1   22
24  32.3/ 56.7/ 11.0         One Man Army v1.0           Ian Sutton 107.8   28
25   4.0/  0.0/  0.0                      test       Philip Kendall  12.0    1

Top 25 Averages:
    39.2/ 35.0/ 22.0                                                139.5   24
______________________________________________________________________________
The Hint--by Philip Kendall

Some pspace engines

Whilst I was developing NCC-1701-A (the Starship Enterprise, for any
non-trekkies out there :-) ), a pspaced one shot and suicidal stone, I got the
feeling that the simple switch-on-loss pspace algorithm wasn't working that
well: an unlucky loss for my one shot would kick the stone in, which would
then lose again, and my losses would be doubled. So, I went looking for some
more complex pspace algorithms, but didn't find anything that really grabbed
my attention. Quite a few concentrated on detecting brainwashing, and
recovering from it, but at the time I wrote Enterprise, there weren't any
brainwashers on the hill, and there were a lot of qscans, making fast response
times crucial. Eventually, a couple of things that looked like what I wanted
showed up: the switcher from Core Warrior 39, which switched on
loss/loss,loss/tie,tie/loss or tie/tie and that used in Ian Sutton's Oblivion,
which switched on n losses without a win. However, both of these looked like
they could have a couple of cycles and instructions shaved off them, so I went
about building my own. Whilst I was at it, I built up a small library of
pspace routines, which is basically what's here - the entry point for all
routines is pGo, and also any constants are defined only in the first switcher
they are used in, so check back if you get any undefined symbol errors.

(For those of you not familiar with pspace, Beppe wrote a brief introduction
in Core Warrior 5, available from Planar's page:

http://pauillac.inria.fr/~doligez/corewar/

as are all warriors mentioned in this article)

Basic switch-on-loss from Core Warrior 5

This is just the switcher used by Beppe in Core Warrior 5, just re-labelled.
It's probably the simplest switcher possible: it's main virtues are that it
is short and fast (always good!) and that it won't suicide if brainwashed.
However, as mentioned above, spurious losses will mean that the optimal
strategy will not always be running, and this costs points.

One simple modification which can be made to this is to change the pThink line
to sne.ab #1,pGo which changes this from a switch-on-loss to a switch-on-loss
or tie.

pResult equ     0               ; pMARS puts results in here
pSpace  equ     1               ; we store our current strategy here
pNum    equ     2               ; how many strategies are we using?

pGo     ldp.ab  #pResult,#0
        ldp.a   #pSpace,pTable
pThink  sne.ab  #0,pGo
        add.a   #1,pTable
        mod.a   #pNum,pTable
        stp.ab  pTable,#pSpace
pTable  jmp.a   @0,strat1
        dat.f   0,strat2
        [other strategies if you want them, remember to increase pNum]

        end     pGo

Length: 6 + 1/strategy
Cycles to completion: after Win/Tie: 6
                            Loss   : 7

Improved switch-on-loss

This is very similar to the above switcher, but with two changes: firstly, and
less important, the add.a #1,pTable line has been changed to
nop.f }pTable,}-1000: this has two advantages 1) If the b-field of this
instruction happens to be hit very early in the round, the warrior will still
behave properly and 2) It gets a free bomb in. Both minor advantages, but
there are no disadvantages, so why not? The second, and more important, change
is that the pspace value is not re-stored unless it has changed (note that it
still always undergoes a mod before being used); this saves a cycle and leads
to exactly the same behaviour (well, almost exactly... bonus point to the
first person to e-mail me with the difference). Disadvantages of this
switcher: same as before, and also it can't be modified to a switch-on-loss or
tie, without losing it's speed advantage.

If the jmn.b pGood,pGo line is changed to jmn.b pTable,pGo, the switcher gets
another cycle quicker on a win or a tie, but it then has the possibility of
suicide if it is brainwashed and doesn't lose. Whether this is a good thing or
not depends on the number of brainwashers on the hill, what they're
brainwashing with, how quick your boot routine is and countless other things.

pGo     ldp.ab  #pResult,#0
        ldp.a   #pSpace,pTable
        jmn.b   pGood,pGo
        nop.f   }pTable,}-1000
        stp.ab  pTable,#pSpace
pGood   mod.a   #pNum,pTable
pTable  jmp.a   @0,strat1
        dat.f   0,strat2

        end     pGo

Length: 6 + 1/strategy
Cycles: Win/Tie: 5
           Loss: 7

Switch on n consecutive losses

This is the switcher used in NCC-1701-A: if the warrior loses for pLosses
consecutive rounds, then it will switch to the next strategy in its table.
This means that a spurious loss for the optimal strategy won't kick in another
strategy, and so the hill placing is (hopefully) improved. Also, after a win
or a tie, it is as quick as the above switchers, but is quite a bit slower
after a loss, and also bigger.

One potential problem with this switcher is that it is very zero brainwash
sensitive: if it is brainwashed with a zero, the first strategy in the table
will be selected, and the loss counter reset, which could produce problems if
this strategy lost reguarly to the brainwasher. If pLosses is 2, the switcher
can be modified by changing pLoss to ldp.ab #pSpace2,#1 and pThink to jmz.b
pWin,pLoss, to make it sensitive to a 1-brainwash rather than 0-brainwash,
whilst if pLosses>2, then changing pLoss to ldp.ab #pSpace2,#1 and pThink to
cmp.b pLoss,#1 will have the same effect, but increasing the running time by 1
cycle for a loss without switch.

One final modification that can be made is changing the first three lines to

pGo     ldp.ab  #pResult,pJump
        ldp.a   #pSpace1,pTable
pJump   jmp.a   @0,pLoss
        dat.f   0,pTie

which will lead to a switch after pLosses rounds without a win. Note that this
modification is not compatible with the brainwash changes above, and changes
the stats to: Length: 12+1/strategy. Cycles: Win: 6, Tie/Loss no switch:10,
Tie/Loss switch: 12, First round: 4

pSpace1 equ     1               ; used to store the current strategy
pSpace2 equ     2               ; used to store the loss counter
pLosses equ     3               ; how many losses before we switch

pGo     ldp.ab  #pResult,#0
        ldp.a   #pSpace1,pTable
pJump   jmn.b   pWin,pGo
pLoss   ldp.ab  #pSpace2,#0
        nop.f   >pLoss,}-1000
        mod.ab  #pLosses,pLoss
pThink  jmn.b   pWin,pLoss
        nop.f   }pTable,}-2000
        stp.ab  pTable,#pSpace1
pWin    stp.b   pLoss,#pSpace2
        mod.a   #pNum,pTable
pTable  jmp.a   @0,strat1
        dat.f   0,strat2

        end     pGo

Length: 11 + 1/strategy
Cycles: Win/Tie:  6
        Loss: when no strategy switch occurs: 10
                          when switch occurs: 12

Switch on loss, select on tie number 1

This switcher and the next have the same behaviour: on a loss, they will
change to the next strategy in their table, whilst they will select a specific
strategy after a tie. This first switcher (taken from Ian Oversby's Falcon
v0.5, hope he doesn't mind :-) ) is slower but smaller than the second.

pSelect equ     0               ; which to select on tie

pGo     ldp.ab  #pResult,#0
        ldp.a   #pSpace,pTable
        sne.ab  #0,pGo
        add.a   #1,pTable
        sne.ab  #2,pGo
        mov.a   #pSelect,pTable
        mod.a   #pNum,pTable
        stp.ab  pTable,#pSpace
pTable  jmp.a   @0,strat1
        dat.f   0,strat2

Length: 8 + 1/strategy
Cycles:      Win: 7
        Tie/Loss: 8

Switch on loss, select on tie number 2

pGo     ldp.a   #pResult,pJump
        ldp.a   #pSpace,pTable
pJump   jmp.a   @0,pLoss
        dat.f   0,pWin
        dat.f   0,pTie

        [any number of instructions you like in here]

pTie    mov.a   #(pSelect-1),pTable
pLoss   nop.f   }pTable,}-1000
        stp.ab  pTable,#pSpace
pWin    mod.a   #pNum,pTable
pTable  jmp.a   @0,strat1
        dat.f   0,strat2

Length: 9 + 1/strategy
Cycles: First round: 4
                Win: 5
                Tie: 8
               Loss: 7

Switch on n losses without a win

This switcher is very similar to the switch on n consecutive losses switcher
above, but has different enough behaviour to warrant a separate entry (I
think, and I'm writing this, so it does!). The only difference here is that a
tie will not reset the loss count, so a sequence of loss-tie-loss-loss will
cause a switch, if pLosses is equal to 3. Note that this is both smaller and
faster than that used by Ian Sutton in Oblivion :-)

pGo     ldp.ab  #pResult,pJump
        ldp.a   #pSpace1,pTable
pJump   jmp.a   @0,pLoss
        dat.f   0,pWin
        dat.f   0,pTie

        [any number of instructions here]

pLoss   ldp.ab  #pSpace2,#0
        nop.f   >pLoss,}-1000
        mod.ab  #pLosses,pLoss
pThink  jmn.b   pWin,pLoss
        nop.f   }pTable,}-2000
        stp.ab  pTable,#pSpace1
pWin    stp.b   pLoss,#pSpace2
pTie    mod.a   #pNum,pTable
pTable  jmp.a   @0,strat1
        dat.f   0,strat2

Length: 13+1/strategy
Cycles:     First round: 4
                    Win: 6
                    Tie: 5
        Loss:    switch: 12
              no switch: 10

Now, the difficult question: which of these switchers should you use? Well, as
you'd expect, there's no simple answer to that: it depends on your components
and the warriors on the hill, and the warriors to come on the hill in the
future. All these switchers have fast response times, meaning that quickscans
are not a serious problem, if you have fast boot routines, but are quite
sensitive to brainwashing. This reflects the make-up of the hill when I wrote
them, but who's to say what the future will hold? - a brainwashing paper has
already appeared on the hill...

Other switchers I could mention include that used by Paul Kline in Yogi Bear,
which can actually have different responses for each component depending on
whether a win, a loss or a tie occured, but which is rather big and slow, and
that used by John K Wilkinson in Hazy Shade II, which is very resistant to
brainwashes.

Philip Kendall
pak21@cam.ac.uk

-----------------------------------------------------------------------------
Extra Extra
NCC-1701-A by Philip Kendall

By most successful '94 warrior to date, there's nothing really original in
this warrior apart from the switcher - everything else has been seen before.
As it comes in three parts, Phasers, a suicidal stone, Photon Torpedoes, a
one-shot scanner and the switcher, I'll make some quick comments on each part
individually:

1. Phasers: this is basically Carbonite, taken from Ian Sutton's Oblivion,
with just a few changes by me: firstly, I increased the bombing run to its
maximum duration (about another 30 bombs in 3500), and also I made the spare
field on the spl drive the djn stream. As Beppe mentioned back in Core Warrior
31, this has three advantages: it make the djn stream cover a wider area
(decrementing most of a warrior will normally be effective), it can trigger
more cmp scans, and it can decrement a warrior without triggering its
decrement detector (eg jmz.b loop,#0 in Torch t18). The boot routine has also
been changed slightly. The suicidal tendency of this component is an advantage
here, as it means the switcher can be more responsive, as Phasers tends to
either win or lose, with very few ties.

2. Photon Torpedoes: this is just One Shot, as was seen in the lower reaches
of the hill a while back: it was designed specifically as a stone/imp killer,
and still does that job quite effectively, even when pspaced with Phasers, but
maybe a spl/spl/dat clear would be better than the stargate clear used here on
the hill as it is - oh well, ideas for the future!

3. Captain Kirk: this switcher, a switch on 5 consecutive losses (see above)
basically has the effect of switching at most once during the fight - it
starts off with Phasers active, and if something beats this 5 times
consecutively, then Photon Torpedoes will be used instead; whilst many things
can get 5 consecutive wins against Phasers, due to its suicidal coreclear, not
much get can do this against Photon Torpedoes, meaning that this component
will tend to stay active once it is switched to.

As I write this, Memories, which NCC-1701-A trashed due to its pure stone, has
just been kicked off the hill, so I predict a downward jump for the Enterprise
:-( Well, it was good while it lasted! One last thing - in case you hadn't
noticed, most of the source code has been available via ;show source, but
here's the full version, with all the constants etc as on the hill, so don't
abuse them...

;redcode-94
;name NCC-1701-A
;author Philip Kendall
;strategy Captain Kirk is commanding the USS Enterprise
;strategy He has two weapons at his disposal:
;strategy 1) Photon Torpedoes (aka One Shot)
;strategy 2) Phasers (modified Carbonite)
;strategy Original self-destructed over Genesis to prevent Khan
;strategy from gaining possession
;strategy The new version has an improved phaser array
;strategy Also, Kirk has had advanced tactical training from Starfleet
;assert CORESIZE==8000
;planar pspace,boot,stone,scan,clear,gate
;show source

;show off
tStep   equ     30
tSep    equ     15
tStream equ     (tPtr-412)
;show on

tScan1  equ     (tInc+tStep)
tImp    equ     2667
tCstart equ     (tLast+2-tPtr)

tPtr    dat.f   tBomb1,#0               ; scanned-low
tBomb3  dat.f   >tImp,>(2*tImp)
tInc    dat.f   tStep,tStep
tBomb2  spl.a   #(tBomb3-tPtr),tCstart
tLoop   add.f   tInc,tScan
tScan   sne.i   tScan1,tScan1+tSep
        djn.f   tLoop,<tStream
        mov.ab  tScan,tPtr
tBomb1  spl.a   #(tBomb2-tPtr),tCstart
tClear  mov.i   *tPtr,>tPtr
        mov.i   *tPtr,>tPtr
tLast   djn.f   tClear,<tStream

        spl.a   #1,1
        spl.a   #1,1
        spl.a   #1,1
        dat.f   (tBomb1-tPtr),#0        ; scanned-hi

;show off
tBdist  equ     3018
;show on

tBoot
i       for     (tLast-tPtr+1)
        mov.i   (tPtr+i-1),>tBptr
        rof
        spl.a   *tBptr,>-1000
        div.f   tBptr,tBptr
tBptr   dat.f   (tScan+tBdist),(tPtr+tBdist) ; scanned-low

        spl.a   #1,1

;show off
pspace1 equ     318
pspace2 equ     167
;show on

losses  equ     4

kirk    ldp.ab  #0,#0
        ldp.a   #pspace1,strat
        jmn.b   win,kirk
loss    ldp.ab  #pspace2,#0
        nop.f   >loss,}-400
        mod.ab  #losses,loss
        jmn.b   win,loss
        nop.f   }strat,>-800
        stp.ab  strat,#pspace1
win     stp.b   loss,#pspace2
        mod.a   #2,strat
strat   jmp.a   @0,pBoot
        spl.a   #1,tBoot

        dat.f   1,1                     ; scanned-hi
        spl.a   #1,*1

;show off
pBdist  equ     -2138
;show on

pBoot   mov.i   {pBomb,{pBptr
        mov.i   pBomb,@pBptr
        mov.i   {pBomb,{pBptr
        mov.i   {pBomb,{pBptr
        mov.i   {pBomb,{pBptr
        spl.a   *pBptr,<4000
        div.f   pBptr,pBptr
pBptr   dat.f   #pStart+pBdist,#pStart+pBdist-pOffset-4

        spl.ab  *1,#1
        spl.ba  *1,#1
        spl.f   *1,#1
        spl.x   *1,#1
        spl.i   *1,#1
        spl.a   #1,#1                   ; scanned-low
        spl.a   #1,*1
        spl.b   #1,*1

;show off
pOffset equ     15
pStep   equ     197
pStream equ     (pStart-1152)
;show on

pStart  spl.a   #0, <pStream
pLoop   mov.i   (pStart-pOffset), pStep
pHit    add.ab  #pStep,pLoop            ; gets bombed to start coreclear
        djn.f   pLoop, <pStream
pBomb   dat.f   >0, >2667               ; a-field changed to -1 by boot

        spl.a   *1,#1
        spl.b   *1,#1
        spl.ab  *1,#1
        spl.ba  *1,#1
        spl.f   *1,#1
        spl.x   *1,#1
        spl.i   *1,#1
        spl.a   #1,#1                   ; scanned-hi
        spl.a   #1,*1
        spl.b   #1,*1
        spl.ab  #1,*1
        spl.ba  #1,*1
        spl.f   #1,*1
        spl.x   #1,*1
        spl.i   #1,*1
        spl.a   *1,#1
        spl.b   *1,#1
        spl.ab  *1,#1
        spl.ba  *1,#1
        spl.f   *1,#1
        spl.x   *1,#1
        spl.i   *1,#1
        dat.f   0,0                     ; scanned-low
        spl.a   #1,1
        spl.a   #1,1
        spl.a   #1,1
        spl.a   #1,1
        spl.a   #1,1
        spl.a   #1,1
        spl.a   #1,1
        spl.a   #1,1
        spl.a   #1,1

        end     kirk
_____________________________________________________________________________
Questions?  Concerns?  Comments?  Complaints?  Mail them to people who care.
authors: Beppe Bezzi <bezzi@nemo.it> or Myer Bremer <bremermr@ecn.purdue.edu>
or Anton Marsden <amarsden@etherspace.gen.nz>
© 2002-2005 corewar.info. Logo © C. Schmidt