From news-rocq.inria.fr!jussieu.fr!oleane!newsxfer3.itd.umich.edu!infeed1.internetmci.com!newsfeed.internetmci.com!news.webspan.net!newsfeeds.sol.net!sol.net!spool.mu.edu!newsspool.sol.net!munnari.OZ.AU!comp.vuw.ac.nz!regent.mcs.vuw.ac.nz!amarsden Tue Jul 22 13:18:37 1997 Article: 7717 of rec.games.corewar Path: news-rocq.inria.fr!jussieu.fr!oleane!newsxfer3.itd.umich.edu!infeed1.internetmci.com!newsfeed.internetmci.com!news.webspan.net!newsfeeds.sol.net!sol.net!spool.mu.edu!newsspool.sol.net!munnari.OZ.AU!comp.vuw.ac.nz!regent.mcs.vuw.ac.nz!amarsden From: Anton Marsden Newsgroups: rec.games.corewar Subject: Anton's Core War Tournament Round 2 Rules Date: Tue, 22 Jul 1997 18:52:55 +1200 Organization: School of Mathematical and Computing Sciences, VUW Lines: 164 Message-ID: NNTP-Posting-Host: kaukau.mcs.vuw.ac.nz Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Cache-Post-Path: kaukau.mcs.vuw.ac.nz!unknown@regent.mcs.vuw.ac.nz The objective in this round is to write a warrior that scores a lot against Electric Head (as published in Core Warrior 59). Each warrior will have 1000 fights against Electric Head and the winner is the one that scores the most. The deadline for entries is Friday, 1 August, 1997. Here is the code for Electric Head: ;redcode-94 ;name Electric Head ;author Anton Marsden ;strategy P-Warrior which uses the P^2 switcher (see CW 58) ;assert CORESIZE==8000 ;kill Electric Head ;-------------- ;THE CORE CLEAR ;-------------- gate1 EQU (bomb1-19) gate2 EQU (bomb1-18) bomb2 EQU (bomb1+22) cca EQU (-4000) dat 19 , 500 ; 1: 1/1 dat -4040 , 4045 ; 2: 2/2 bomb1 spl #bomb2-gate1 , 45 ;20: 5/4 mov *gate1 , >gate1 ; 1: 1/1 mov *bomb2+2, >gate2 ; 2: 2/2 djn.f -1 , {gate2 ; 3: 3/3 dat 1 , 45 ; 2: 2/2 spl #-40 , 45 ; 3: 3/3 ccb mov bomb1-1,@ccd mov {-1,ptr,>ptr jmn.f kill,>ptr a: add #step+1,@mptr scan: jmz.f a,-1,>1 in dat 0,loss_table-state p spl 1,win_table-state spl 1,tie_table-state ;---------- ;MINI PAPER ;---------- spl @0,1234 mov }-1,>-1 mov {-2,<1 jmp @0,>5678 PSTATE EQU 250 ; pspace location containing current state STATES EQU 10 ; maximum number of states (for brainwash protection) ;NOTE: state values go from 0 to STATES-1 w0 EQU ccb ; THE CORE CLEAR w1 EQU boot ; MINI HSA w2 EQU p ; MINI PAPER w3 EQU cboot ; CARBONITE think ldp.a #0,in ; get input value load ldp.a #PSTATE,state ; load old state mod.a #STATES,state ; brainwash protection add.ba *in,state ; select correct state table store stp.a *state,load ; store new state win_table state jmp @0,w0 ; jump to warrior code init_state spl #0,w0 spl #0,w0 spl #3,w1 spl #3,w1 spl #4,w1 spl #6,w2 spl #7,w3 spl #7,w3 spl #8,w3 tie_table spl #1,w0 spl #2,w0 spl #3,w1 spl #3,w1 spl #4,w1 spl #5,w1 spl #0,w0 spl #7,w3 spl #8,w3 spl #9,w3 loss_table spl #1,w0 spl #2,w0 spl #3,w1 spl #4,w1 spl #5,w1 spl #6,w2 spl #7,w3 spl #8,w3 spl #9,w3 spl #3,w1 ;----------- ;CARBONITE++ ;----------- caway EQU (-100) cboot mov tar+1,