From news-rocq!nslave.kpnqwest.net!nmaster.kpnqwest.net!npeer.kpnqwest.net!news.maxwell.syr.edu!newspeer1.nac.net!news.ttsg.com!adamow@if.pw.edu.pl Tue Apr 10 16:59:29 2001 Article: 12502 of rec.games.corewar Path: news-rocq!nslave.kpnqwest.net!nmaster.kpnqwest.net!npeer.kpnqwest.net!news.maxwell.syr.edu!newspeer1.nac.net!news.ttsg.com!adamow@if.pw.edu.pl From: Lukasz Adamowski Newsgroups: rec.games.corewar Subject: Re: First Warrior Date: 6 Apr 2001 10:28:40 -0400 Organization: TTSG Lines: 76 Distribution: world Message-ID: Reply-To: adamow@if.pw.edu.pl NNTP-Posting-Host: odin.ttsg.com X-Trace: odin.ttsg.com 986567320 14576 216.231.111.29 (6 Apr 2001 14:28:40 GMT) X-Complaints-To: abuse@news.ttsg.com NNTP-Posting-Date: 6 Apr 2001 14:28:40 GMT Originator: corewar-l@koth.org Xref: news-rocq rec.games.corewar:12502 On Tue, 3 Apr 2001, Daniel Malboeuf wrote: > It's my first warrior and I'm looking for tips on how > to improve it etc. > > ;redcode > ;name EBOLA strain 2.1 > ;version 2.1 > ;date 02/04/01 > ;author DC Malboeuf > ;strategy stun + clear > ;strategy Stun every 8th address of the core > ;strategy after each pass through memory launch a > core clear > ;assert CORESIZE==8000 > > step equ 8 > scan equ 32 > > reset mov a1,b1 ;reset after > clear > mov a2,b2 > jmp begin > a1 mov -5, -20 > a2 dat $0,$0 > > gun spl 0 ;stun > ptr dat #scan, #scan > begin mov gun,@ptr > add #step,ptr > jmn begin, ptr > > mov #scan, ptr ;clear > b1 mov ptr, -20 > sub #1, b1 > jmz b1, b2 > jmp reset > b2 dat $0, $0 > > end Not bad. But... Clears usually use decrement instead of SUB #1, b1 (actually modern clears use increment to be sure no imps survive). That would looks like: [...] b1 mov ptr, <-20 jmz b1, b2 [...] That's one instruction less and only 2 instructions in loop, so 150% times faster. To make your warrior more effective against b-field scanners you can make it "quiet" by avoiding non-zero b-fields and using a-field indirect addressing. I.e. stun loop can be done like this: [...] ptr dat #scan, $0 begin mov gun, *ptr add.a #step, ptr jmz.a begin, ptr ; actually I'm not sure if it will work, sorry ;) mov.a #scan, ptr [...] I cannot check the JMN.A instruction now, but general idea is that whole pointering is made by a-field. It works only under extended instruction set, but that's not a problem, most of nowadays hills allows it. Another thing, clear or bomber (like your stunning code) can also work as gate, but I won't write about it here, sorry, I have no more time. Happy coding! Lukasz