From news-rocq.inria.fr!univ-lyon1.fr!ghost.dsi.unimi.it!batcomputer!hookup!news.kei.com!eff!news.umbc.edu!europa.eng.gtefsd.com!howland.reston.ans.net!agate!soda.berkeley.edu!mconst Wed Apr 20 15:09:49 1994 Article: 666 of rec.games.corewar Path: news-rocq.inria.fr!univ-lyon1.fr!ghost.dsi.unimi.it!batcomputer!hookup!news.kei.com!eff!news.umbc.edu!europa.eng.gtefsd.com!howland.reston.ans.net!agate!soda.berkeley.edu!mconst From: mconst@soda.berkeley.edu (Michael Constant) Newsgroups: rec.games.corewar Subject: More Source Postings Date: 19 Apr 1994 22:13:24 GMT Organization: Society for the Prevention of Cruelty to Vegetables, UC Berkeley Lines: 231 Message-ID: <2p1l24$35l@agate.berkeley.edu> NNTP-Posting-Host: soda.berkeley.edu Here is the source for all the programs (mostly quite bad) that I've submitted recently to the standard '94 hill at pizza. I would encourage everyone else out there to post the code even for your bad programs, because often others can profit by your mistakes and even improve your programs to the point where they become really viable. First and foremost is Sauron v1.8, currently a strong second place on the Pizza '94 hill. (Don't you just *love* it when people (like me) are soooooo nice (like me) that they post their prize program as soon as it gets a good score on the hill?) Sauron is a combination program, with the main feature (at least the one which takes up the most space in the code) being the quick-scan (label "look"). If it finds anything with the quick- scan, Sauron will bomb it with spl/jmps (as documented in the program, I got the idea (and a bit of the implementation) for spl/jmp from Mike Nonemacher's Blitzkrieg (I was using spl-carpet, which didn't work as well because it covered less distance in the same amount of time)). After the spl/jmp bombing, Sauron will do a double coreclear which degenerates into a hyperperfect gate (the name I made up just now for a gate which will keep out gate-crashing imps; so-called because it's even more perfect than the standard "perfect" gate.) However, if no enemy is found with the initial quick-scan, Sauron will launch a 3x2 imp-spiral (3 points, 2 layers) and a stone with a partial coreclear (it wipes *almost* the entire core, but it commits suicide right before the last bit is done. I don't consider this to be a serious problem, especially with the imps around to clean up anything the stone leaves). Before you ask: this program was *not* based on Blitzkrieg. In fact when I was writing it I thought it was unique until I took another look around my piles of source listings (yeah, they're on my computer, but they're piles nonetheless... I can be a slob electronically too :-) and found Blitzkrieg. That's when I got the inspiration to change the quick-scan bombing from spl-carpet to spl/jmp. Oh yeah, you were wondering where the poem in the strategy section came in: well, Sauron was called the "Lord of the Rings" and this program was originally designed to beat imps (it actually ended up doing better against scanners). Okay, it's a lame attempt at humor, but *I* thought it was funny... One last thing: I have not tried to make this program easy to read. I'm just posting it as is, so you can have the benefit of seeing it as soon as possible. If you don't understand how some bit of it works, please mail me, I'd be happy to answer any questions you may have. (Among other things, it would mean to me that someone actually read the source to my program and cared about it! Wow!) Besides, it gives me an excuse *never* to clean up the code, since (I can say) I've already posted it, so why bother? :-) Anyway, without further ado: ;redcode-94 ;name Sauron v1.8 ;author Michael Constant ;strategy "Three Rings for the Elven-kings under the sky, ;strategy Seven for the Dwarf-lords in their halls of stone, ;strategy Nine for Mortal Men doomed to die, ;strategy One for the Dark Lord on his dark throne ;strategy In the Land of Mordor where the Shadows lie. ;strategy One Ring to rule them all, One Ring to find them, ;strategy One Ring to bring them all and in the darkness bind them ;strategy In the Land of Mordor where the Shadows lie." ;strategy -- J.R.R. Tolkien, _Lord_of_the_Rings_ ;macro DIST equ 2300 cclear mov split, <-10 ; lazy man's two-pass coreclear :-) jmz.a cclear, last+10 split spl #11, <-30 mov bomb, <-5 jump jmp -1, <-32 f impgen spl 1, stone+4+1 mov -1, 0 spl 1 spl 2 jmp @0, imp add #2667, -1 bomb dat <-31-2668,<-31 ; is this right? I'm not very familiar ; with gate-breaking imps but it seems to ; work against Cannonade. look qscan for 36 ; this would be 38 if there was enough room in the program cmp.x look+((qscan+1)*100), look+4000+((qscan+1)*100) mov.ab #20+look+((qscan+1)*100)-found, @found rof found jmz blind, #0 zap mov.i jump, @found mov.i split, scan count djn -1, #0 jmp scan, 0 [ big DAT 0, 0 spacer removed ] which dat 0, #split split spl -1, #-22 The Red Carpet was my first attempt at a carpet-bombing cmp-scanner, and I don't think I need to post it because it had no innovations and there are a lot of better cmp-scanners out there. Imperfection v3.1 (for regular core) is a standard stone/imp combo. Note the decoy at the *beginning* to confuse any program which assumes decoys at the end (I know several programs which do this but I can't call them to mind right now -- sorry). The coreclearing stone is awful code, but it works... the one in Sauron (qv.) is a lot better (at least vs. scanners). Maybe I should replace it, but I haven't gotten around to trying yet. ;redcode-94 ;name Imperfection v3.1 ;author Michael Constant ;kill Imperfection ;strategy standard stone/spiral ;macro DIST equ 2500 STEP equ 889 IMPBOOT equ 400 org boot foo decoy for 74 spl.i #500+(decoy*3), #decoy+1 rof boot mov stone, stone+DIST mov stone+1,stone+1+DIST mov stone+2,stone+2+DIST mov stone+3,stone+3+DIST mov stone+4,stone+4+DIST mov bar, stone+DIST+4+76 mov bar, stone+DIST+4+75 spl stone+DIST, <-2000 spl stone+DIST, <-3000 launch mov imp, imp+IMPBOOT spl 1, <-2000 mov -1, 0 mov -1, 0 mov -1, 0 spl 1, <-3000 spl 1, <-4000 spl 2, <3000 jmp @0, imp+IMPBOOT add #STEP, -1 bar dat #1, #10 stone mov.i 76 imp mov.i #0, STEP Whew! That's it, I think. Well, I hope to inspire another round of source postings -- there have been a lot of new programs recently. Does anyone else want to reveal their secrets? -- Michael Constant (mconst@soda.berkeley.edu) GM/CS d? p c++++ l u++ e(*) m++ s--/- h f+(++) g++ w++ t+++ r+@ !y