Path: ibmpcug!gwen.pcug.co.uk!dish.news.pipex.net!pipex!tank.news.pipex.net!pipex!swrinde!emory!nntp.msstate.edu!nntp.memphis.edu!nntp.rhodes.edu!hal.mathcs.rhodes.edu!graham Newsgroups: rec.games.corewar Subject: Swing source Message-ID: <1995Jul14.162510.2805@rhodes> From: graham@hal.mathcs.rhodes.edu (Randy Graham) Date: 14 Jul 95 16:25:09 -0500 Keywords: redcode, Swing Summary: Source for Swing Nntp-Posting-Host: hal.mathcs.rhodes.edu X-Newsreader: TIN [version 1.2 PL2] Lines: 115 Well, not long ago, P.Kline got on the hill with Rude Wind II. The strategy line says once-thru 80% bomb/scan. I have source for Rude Wind, and saw how it accomplished 75%, and have just figured out how to make a scanner do 80% (a la Taking Names), but I couldn't imagine how Rude Wind II could achieve 80% on a once through. So, I sat down and worked on it. I eventually got something working, but I couldn't improve a warrior with it. Everything I added the frond end to did worse. I guessed my problem was an inefficient attack on a find, but how to fix it. I had tried using Paul's earlier post about a multi-pass core clear, but just couldn't get it to work. When he finally posted Withershins Thrice and I saw something actually using the technique, I understood it and added it to my front-end. Now, my front end adds, bombs, scans, adds, scans, loops. So, one bomb, four scans, six lines of code = 83.3%. But, I still couldn't catch up with Withershins Thrice. So I tried the only thing I could think of to slow down WitherShins Thrice - I added a djn.f stream to my looper instead of a djn.b counter. This made Withershins Thrice start the sweep earlier, giving me extra time to find him. As an extra bonus, it also slows down some scanners (sling, Taking Names, etc.), thus really helping my score. Of course, the trick is scanning now so I still stop after once through and I don't bomb myself, but with the placing it correctly. Just the addition of the djn stream added 20 points to my score. So, here are my results from the hill as of this post. W L T Versus: === === === Withershins Thrice 58 42 0 Thermite 1.0 55 32 13 quiz 55 30 15 Rude Wind II 31 60 9 (this one surprised me. I want source ;-) Agony II 17 77 6 (same problem as Paul here. Sigh...) Taking Names 48 45 7 Torch t17 60 38 2 Marcia Trionfale 52 22 26 nobody special 49 26 25 juliet storm 45 47 8 Blue Funk 3 60 30 10 TimeScape 36 30 34 Test10 36 33 31 HeremScimitar 50 45 5 Iron Gate 1.5 47 51 2 Sling 60 38 2 feeble attempt 4 42 32 26 B-Panama X 72 21 7 Keystone 70 26 4 overall score: 160.619048 # %W/ %L/ %T Name Author Score Age 1 49/ 38/ 12 Swing Randy Graham 161 2 2 49/ 38/ 12 Withershins Thrice P.Kline 160 20 3 36/ 25/ 39 Rude Wind II P.Kline 147 40 4 40/ 37/ 23 Thermite 1.0 Robert Macrae 144 220 5 43/ 44/ 13 Agony II Stefan Strack 143 497 6 42/ 42/ 16 quiz Mike Nonemacher 143 109 7 42/ 48/ 10 Taking Names P.Kline 137 136 8 36/ 38/ 26 Torch t17 P.Kline 133 50 9 24/ 17/ 59 nobody special Mike Nonemacher 131 115 10 26/ 21/ 54 Marcia Trionfale Beppe Bezzi 131 12 11 29/ 28/ 43 juliet storm M R Bremer 129 113 12 22/ 15/ 62 TimeScape (1.0) J. Pohjalainen 129 135 13 26/ 24/ 50 Test10 Beppe Bezzi 128 1 14 38/ 48/ 14 Iron Gate 1.5 Wayne Sheppard 127 851 15 30/ 33/ 37 Blue Funk 3 Steven Morrell 126 562 16 36/ 47/ 16 HeremScimitar A.Ivner,P.Kline 125 381 17 37/ 49/ 13 Sling Randy Graham 125 8 18 23/ 23/ 54 feeble attempt 4 M R Bremer 123 9 19 23/ 23/ 54 B-Panama X Steven Morrell 123 503 20 29/ 43/ 27 Keystone P.Kline 115 203 And source (minus EQU lines) with apologies to Paul for stealing his multi-pass core clear from Withershins Thrice. I still have some tweaking to improve versus small step scanners, but I thought I'd let everyone see my source. ;redcode-94 ;name Swing ;kill Swing ;Author Randy Graham ;assert 1 ;strategy 83.3% bomb/scan with djn stream once-thru then ;strategy multi-pass core clear dat.f #gate-10, swinger-gate+5 gate dat.f #gate-10, sneer-(STEP*2)-5 dat2 dat.f #gate-20, swinger-gate+5 dat1 dat.f #gate-25, swinger-gate+5 site2 spl.a #gate-35, swinger-gate+5 site spl.a #gate-30, swinger-gate+5 for 4 dat.f 0, 0 rof step dat.f #-12, <-2667 spladd spl.a <-24, <-24 adder sub.f spladd, sneer hitter mov.i step, @sneer sneer sne.i step+STEP*5, *step+STEP*4 subber sub.f sweeper, sneer sneer2 sne.i *sneer, @sneer looper djn.f adder, gate swinger djn.b mover, {site end hitter Randy