From news-rocq.inria.fr!univ-lyon1.fr!in2p3.fr!swidir.switch.ch!swsbe6.switch.ch!surfnet.nl!howland.reston.ans.net!newsfeed.internetmci.com!netnews.nwnet.net!news.nodak.edu!plains!ngreen Thu May 23 10:48:24 1996 Article: 5239 of rec.games.corewar Path: news-rocq.inria.fr!univ-lyon1.fr!in2p3.fr!swidir.switch.ch!swsbe6.switch.ch!surfnet.nl!howland.reston.ans.net!newsfeed.internetmci.com!netnews.nwnet.net!news.nodak.edu!plains!ngreen From: ngreen@plains.nodak.edu (Nathan D Green) Newsgroups: rec.games.corewar Subject: Cheater 2.0 Date: 22 May 1996 06:52:08 GMT Organization: North Dakota Higher Education Computing Network (NDHECN) Lines: 226 Message-ID: <4nudio$llf@daily-planet.nodak.edu> NNTP-Posting-Host: plains.nodak.edu Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Newsreader: TIN [version 1.2 PL2] Well, I think I'm done playing with magic -F number for now. Cheater 2.0 does much better than version 1, but still doesn't do well against the warriors on the veteran hill. I'm posting the code in case anyone wants to play with it. Note: The magic -F number has been altered to protect the innocent hills. Any resemblance to magic numbers for past or future hills in completely coincidental. Use -F 1234. The main problem is that without knowing where the opponent is, Cheater is a horrible warrior. If the round counter in p-space is incorrect, Cheater will attack the wrong spot. Also, there isn't enough room to put all the starting addresses. But based on the horrible results, I don't think it runs out before the counter is corrupted. First, Cheater 2.0 loads its opponent's starting address from pspace and covers it with SPL 0 bombs. It then checks at negative that address to see if it needs to change its strategy from trying to get on the hill to defending its position on the hill. (All of the addresses will be reversed) Now that the enemy is (hopefully) stunned, it figures out where the first attack for the next round should be, negates it if defending, and adds an offset to it. This offset is incremented if Cheater lost the last round. In this way, Cheater learns where hitting its opponent hurts most. Its strategy for the next round figured out, Cheater cleans up the core with a SPL/DAT clear and an imp gate (To clean up anything that may have had time to launch). When this all works without blowing up, Cheater hits its opponent where it hurts most starting on cycle 3. On visual display, you can see the opponent get a few of its instructions copied for bootstraping before it is stunned. Here are some of the reasons why I think this blows up so much: #1 Round 1. Cheater hasn't found its opponents weak spot. Opponent has time to boot away and attack. Opponent is a p-space wiper. Round counter is wiped. End of story. Cheater gets <10 wins. #2 Cheater has managed to find opponent's weak spot. Law of probability eventually causes opponent to try to bootstrap over round incrementer. Round count becomes incorrect. Cheater wins 30-100. Any ideas for making this more robust? Comparison of Cheater 2.0 with Control 2.0 (same thing, wrong numbers) on the veteran hill. Your overall score: 55.096154 26 13/ 72/ 15 Control 2.0 Nathan Green 55 0 Your overall score: 99.711538 26 30/ 60/ 11 Cheater 2.0 Nathan Green 100 0 ----- ;redcode-94 ;name Cheater 2.0 ;author Nathan Green ;strategy Use knowledge of the -F number to my advantage ;assert CORESIZE==8000 ; Use "pmars -F 1234" RESULT equ #0 ROUND equ #1 NUM equ #2 DEFEND equ #3 OFFSET equ #4 ptr dat.f 20,1234 ; B-field is the -F number round ldp.ab NUM,#0 ; Load attack address from p-space add.b round,ptr ; Offset by magic number (round 1 = 0+magic) loop mov.i bomb,>ptr ; Hit 'em mov.i bomb,>ptr djn.b loop,#10 x ldp.ab ROUND,#0 ; Increment round counter. add.ab #1,x mov.b x,bomb stp.b x,ROUND sub.ba ptr,ptr ; Check if opponent is at negative position seq.i *ptr,ptr-1 stp.ab #1,DEFEND ; If so, plan on reversing attacks in future div.ab #2,bomb ; Calculate array position for next number mod.ab #2,x add.ab #1,bomb seq.b x,#0 ; Retrieve address. mov.ba @bomb,@bomb mov.ab @bomb,ptr y ldp.ab DEFEND,#0 ; Reverse if we are defending jmz.b z,y sub.ba ptr,bomb mov.ab bomb,ptr z ldp.ab OFFSET,#0 ; If we lost, increment offset res ldp.ab RESULT,#1 sne.ab #0,res add.ab #2,z add.b z,ptr ; add the offset to the address stp.b z,OFFSET done stp.b ptr,NUM ; Store next attack address in p-space clear mov bomb,@last ; Clean up anything that may have booted. djn.b clear,last clear2 mov bomb2,*last djn.a clear2,last jmp #0,21.5 C+++ UV P>+ L++>+++ E W N++ o++ K+ w---(--) M- V PS PE Y t+ 5 X R tv-(--) b++>+++ DI++>+++ D+ G+>++++ e(*)>+ h!>++ !r !y+ (Version 3.1)