From news-rocq!jussieu.fr!math.ohio-state.edu!howland.erols.net!torn!cyclone.bc.net!newspump.monmouth.com!newspeer.monmouth.com!nntp2.deja.com!nnrp1.deja.com!not-for-mail Wed Jun 30 13:45:45 1999 Article: 10358 of rec.games.corewar Path: news-rocq!jussieu.fr!math.ohio-state.edu!howland.erols.net!torn!cyclone.bc.net!newspump.monmouth.com!newspeer.monmouth.com!nntp2.deja.com!nnrp1.deja.com!not-for-mail From: Ben Ford Newsgroups: rec.games.corewar Subject: Pattel's Virus Date: Tue, 29 Jun 1999 05:30:12 GMT Organization: Deja.com - Share what you know. Learn what you don't. Lines: 165 Message-ID: <7l9ll5$6nf$1@nnrp1.deja.com> NNTP-Posting-Host: 207.170.76.166 X-Article-Creation-Date: Tue Jun 29 05:30:12 1999 GMT X-Http-User-Agent: Mozilla/4.5 [en] (WinNT; U) X-Http-Proxy: 1.0 x28.deja.com:80 (Squid/1.1.22) for client 207.170.76.166 Xref: news-rocq rec.games.corewar:10358 Well, Pattel's Virus finally fell off the hill at the age of 52. Its weaknesses to papers and stone/papers finally caught up to it. But it did fairly well for the first warrior I got to stick on the hill for any length of time. There isn't much new code in it, just a bunch of components thrown together from various sources combined with the P^3 switcher. I think I made at least one minor tweak to each of the components. One part I think is neat is overlapping the spl's for the paper with the mod numbers for the switcher, saves a few lines of code. The logic can probably be improved since forcing the p^3 to always picks the scanner scores way higher against a range of papers than the hill scores indicated. ;redcode-94 ;name Pattel's Virus ;author Ben Ford ;strategy p^3: clear / scissor / paper / stone ;assert CORESIZE == 8000 && MAXLENGTH >= 100 org think ; **** P-SPACE BRAIN **** STORE equ 256 ; state storage location w0 equ dwarf w1 equ clear w2 equ scissor w3 equ paper think ldp.a #0, in ldp.a #STORE, table mod.ba *in, table stp.b *table, #STORE ; LL WW TT table jmp }0, 226 ; =(22*10)+ 6=(25* 9)+ 1=(20*11)+ 6 ;initial state dat w0, 650 ; =(65*10)+ 0=(72* 9)+ 2=(59*11)+ 1 dat w0, 101 ; =(10*10)+ 1=(11* 9)+ 2=( 9*11)+ 2 dat w1, 886 ; =(88*10)+ 6=(98* 9)+ 4=(80*11)+ 6 dat w1, 653 ; =(65*10)+ 3=(72* 9)+ 5=(59*11)+ 4 dat w1, 104 ; =(10*10)+ 4=(11* 9)+ 5=( 9*11)+ 5 dat w2, 889 ; =(88*10)+ 9=(98* 9)+ 7=(80*11)+ 9 dat w2, 656 ; =(65*10)+ 6=(72* 9)+ 8=(59*11)+ 7 dat w2, 107 ; =(10*10)+ 7=(11* 9)+ 8=( 9*11)+ 8 dat w3, 630 ; =(63*10)+ 0=(70* 9)+ 0=(57*11)+ 3 dat w0, 226 ; =(22*10)+ 0=(25* 9)+ 1=(20*11)+ 6 ;unreachable in dat 0, 10 ; must have non-zero b-field in the previous cell paper spl 2, 9 spl 2, 11 spl 1, >-400 ; ***** PAPER ***** p1 equ 2333 p2 equ 1737 spl @0, >p1 mov }-1, >-1 mov {-2, <1 spl @0, >p2 mov.i #2*p1, }-p1 ; ***** CLEAR ***** CDIST equ 2500 clear mov.ab #clend+3, @kdst add #cstart-2-gate, kdst mov cbmb, >kdst mov cbmb, >kdst ksrc spl @kdst, cstart mov >ksrc, >kdst mov >ksrc, >kdst mov >ksrc, >kdst mov >ksrc, >kdst spl @kdst, cstart mov >ksrc, >kdst mov >ksrc, >kdst mov >ksrc, >kdst mov >ksrc, >kdst kdst div.f #0, think+CDIST+gate-cstart gate equ (cstart-5) ; dat 0, 0 ; dat 0, 0 ; dat <-2666, <2667 cbmb dat <-2666, <2667 cstart spl #0, gate mov cbmb, >gate djn.f -1, {gate spl #0, gate mov cbmb, >gate clend djn.f -1, {gate ; **** SCISSOR **** STEP equ 5379 SDIST equ (think+5923+sclr-scan) sgate equ (scan-2) scissor mov *sclr, @sptr mov {sclr, scan-1 pscan jmz.f scan, @scan slt scan, #sclr+1-scan chg mov.i @pscan, @mv chk jmn scan, scan mov.f dclr, >chk djn.f 1 Sent via Deja.com http://www.deja.com/ Share what you know. Learn what you don't.