From news-rocq.inria.fr!jussieu.fr!oleane!tank.news.pipex.net!pipex!newsfeed.internetmci.com!in2.uu.net!news.new-york.net!news.stormking.com!amarsden@Comp.VUW.AC.NZ Thu Mar 21 14:26:39 1996 Article: 4474 of rec.games.corewar Path: news-rocq.inria.fr!jussieu.fr!oleane!tank.news.pipex.net!pipex!newsfeed.internetmci.com!in2.uu.net!news.new-york.net!news.stormking.com!amarsden@Comp.VUW.AC.NZ From: Anton Marsden Newsgroups: rec.games.corewar Subject: Re: Spiral Clears Date: 20 Mar 1996 20:14:39 -0500 Organization: Storm King Ind. Inc. Lines: 47 Sender: server@news.stormking.com Distribution: world Message-ID: Reply-To: amarsden@Comp.VUW.AC.NZ NNTP-Posting-Host: valhalla.stormking.com Mime-Version: 1.0 Originator: corewar-l@stormking.com On Wed, 20 Mar 1996, Mr I M Oversby wrote: > Does anyone know why this doesn't work as I hoped it would? > It seems to leave big holes for code to hide in and there are other problems > that I can't quite figure out what they are, let alone how to fix them. > ;redcode-94 > ;name Test > ;author Ian Oversby > ;strategy Spiral Clear > ;strategy I wish I could understand how other peoples > ;strategy coreclears worked :-( > cptr SPL.B #4, #6-381 > ADD.AB #381, cptr > MOV.I *cptr, @cptr > JMP.B -2 > b1 SPL.B #5, #6-381 > b2 DAT.F #5, #6-381 > end Let me guess, your holes are roughly 6 bytes wide and there are 21 of them? Your spiral clear must avoid bombing itself in order to function properly. When avoiding bombing itself it has the side effect of skipping 20 other positions which are about the size of itself. It's _possible_ to avoid this complication by using a SLT but then you can't make the clear split. Another method is to initiate a normal clear after the spiral clear... or incorporate the spiral clear into your bombing/scanning code. I did this with Mirage (I doubt this version will make the Hill): ;There may still be some bugs in this. ;It's also kinda complicated. Key lines are chg and dec ORG s step EQU 3039 gate: data: spl.a #0,$step+pos pos: add.ab #step,#2*step kill: mov.i $bomb,>data s: jmz.f @0,@pos ck: slt.b $pos,#btm-gate+1 chg: mov.i @s,@kill j: jmn.b $pos,$pos mov.f $inc,>j dec: djn.f