Path: ibmpcug!gwen.pcug.co.uk!plug.news.pipex.net!pipex!tank.news.pipex.net!pipex!news.sprintlink.net!in1.uu.net!spcuna!news.stormking.com!bezzi@iol.it From: Beppe Bezzi Newsgroups: rec.games.corewar Subject: Brain Wash Date: 29 Sep 1995 14:55:46 -0400 Organization: Storm King Ind. Inc. Lines: 187 Sender: server@news.stormking.com Distribution: world Message-ID: <199509291935.UAA05787@iol-mail.iol.it> Reply-To: bezzi@iol.it NNTP-Posting-Host: valhalla.stormking.com Originator: corewar-l@stormking.com X-Mailer: Windows Eudora Light Version 1.5.2 One month after their appearance on the hill, p-warriors are not dominating it, even if they have such a powerful tool like p-space that should allow them to score optimal results against all warrior classes. The reasons for this may be many, I like to think one of these is Brain Wash. Brain Wash uses p-space in active mode, using a simple switching routine to try opposing enemy with best component, and uses p-scrambling to attack enemy p-space not to do real damage, a simple MOD is enough to protect your warrior, but to force it switching to a wrong strategy. BW can switch beetween five attack modules: Firestorm, general purpose incendiary bomber, paper, multipass sweep, Tornado, used only when paper loses and the brainwasher that's the paper module with a brainwashing pit attached; using a smart switching I can fit all in 100 lines and still have some spacers. The switcher is very simple: -Win :-) OK go on with same. -Tie :-| Change to next; Firestorm or paper only. -Loss :-( -Paper or brainwasher lost -> enemy scanner -> Tornado bomber. -Firestorm or Tornado lost -> enemy paper or stone imp -> Brainwasher. Simple and self braiwashing resistent. Now the code: ;----------------------- ;redcode-94 ;name Brain Wash 11 ;author Beppe Bezzi ;strategy headache, bad thoughts, combat stress ? ;strategy you need a good Brain Wash :-) ;strategy v 11 little changes ;assert CORESIZE == 8000 ;kill Brain Wash org think ;think first. My grandma told me often :-) _RES equ #0 ;last result _STR equ # ;-strategy in use soap equ 6 ;to put in opponents p-space count equ 750 step equ 55 away equ ;boot distance bcount equ #533 dest1 equ 3740 dest2 equ 1860 firest bootgt mov gate, away mov gate+2, away booincr mov incr, away+23 mov bombm, away+23 boot mov djmp, away+8 mov clr, gate djmp djn.b clr, {gate+2 b for 12 dat 0,0 rof incr dat 2*step, 2*step bombm mov step, >step for 0 note that Firestorm, sweep and Tornado share some code and boot. This allows me to save lot of space Needs some work, done in part with Brain Vamp, and there is a small bug in Tornado clear, but works. rof ;--Tornado bomber setup bomber mov.ab bcount, jump add.f bombm, incr mov.i bombm2, bombm mov.i bstone, stone stp.ab #3, _STR ;if wins continue jmp bootgt bstone mov *step+2, *(2*step)+2 bombm2 mov step, 1 ;This works very well; thanx Paul ;----Sweep setup sweep mov.i bjmp1, bjmp mov.ab #away-3,booincr jmp bootgt bjmp1 jmp @-3 ;-- Think module think res ldp.ab _RES, #0 str ldp.a _STR, str1 ;load strategy in use sne.ab #0, res ;check result jmp bwash1 ;lost go for brainwash jmn.a win, @res ;win ? tie add.a #1, str1 ;tie change strat mod.a #3, str1 ;secure result no Tornado win stp.ab str1, _STR str1 jmp @0, paper ;0 dat 0, firest ;1 dat 0, sweep ;2 dat 0, bomber ;3 ;-- Brainwashing and paper module bwash1 slt.ab str1, #4 ;just brainwashed ? jmp bomber ;yes and lost, go for bomber jmz.a bomber, str1 ;paper lost? yes -> bomber bwash stp.ab #0, _STR ;no -> bwasher spl 1, <1000 ;dobles processes in use to include bwash pit paper spl 1, <300 ;\ spl 1, <300 ;-> generate 7 consecutive processes mov -1, 0 silk spl @0, -1 ;copy self to new location mov bomba, }1001 mov bomba, }2001 mov {silk, dest2 bomba dat <-2666, {1 ;multi use bomb, against imps and clears. Bad with both :-( brain stp.ab #soap, _STR ;fixed value seems to work better wash spl brain,