From news-rocq.inria.fr!jussieu.fr!eerie.fr!news.maxwell.syr.edu!newsfeed.internetmci.com!207.103.147.20!news.voicenet.com!nntp.upenn.edu!msunews!mooredav Wed Feb 18 14:40:26 1998 Article: 8348 of rec.games.corewar Path: news-rocq.inria.fr!jussieu.fr!eerie.fr!news.maxwell.syr.edu!newsfeed.internetmci.com!207.103.147.20!news.voicenet.com!nntp.upenn.edu!msunews!mooredav From: mooredav@cps.msu.edu (David Matthew Moore) Newsgroups: rec.games.corewar Subject: Re: ARRGHH!! My warrior won't work! Date: 17 Feb 1998 17:10:03 GMT Organization: Michigan State University Lines: 82 Distribution: world Message-ID: <6ccg9c$32c$1@msunews.cl.msu.edu> References: <6c9q4h$33hu$1@newssvr04-int.news.prodigy.com> NNTP-Posting-Host: kaligagan.cps.msu.edu X-Newsreader: TIN [version 1.2 PL2] X-MD5: 52749ee59d8e12fef0bff04d949faba4 Margaret Yeager (GNRB30E@prodigy.com) wrote: >Help! I wrote a warrior that I think might work well but it is supposedly >to big by about 100 commands. Here is the code: >;redcode-94 >;name DAT Murderer >;author Josh Yeager >;assert 1 >;strategy It initializes and then sweeps about 98% of the core with JMP 0, >0 >;strategy bombs then it splits into 5 bombers and an imp-gate. The >bombers >;strategy immediately start DAT 0,0 bombing. [code deleted] >Can you figure out why pMARS says that it is more than 100 commands >longer than it's supposed to? I made sure that 100 was maximum commands. >Please don't use my code. Here is the main culprit: count for MAXLENGTH mov count+6,count+3000 rof The preprocessor will expand this into 100 instructions (or whatever else MAXLENGTH is set to!) Frankly, your code is nowhere near working. I've included a version below which implements the strategy that you've outlined. It's not designed to be a competitive warrior but at least it compiles and runs. I would recommend that you check out some of the tutorials that are out there, in addition to the FAQ. BTW, I wouldn't worry too much about others using your code, even after you do get something working. I can only vaguely remember one accusation of code-stealing which happened over 5 years ago. I think most of the people in rec.games.corewar really want to write their own original code; cheating is just not in the good nature of this group. ;redcode-94 ;name The DAT Murderer's Trial ;author Anonymous ;assert 1 ;strategy It initializes and then sweeps about 98% of the core with JMP 0, 0 ;strategy bombs then it splits into 5 bombers and an imp-gate. The bombers ;strategy immediately start DAT 0,0 bombing. org start ; specify execution start step equ 98 ; for the preprocessor only jptr dat 0, 0 jbomb jmp 0, 0 start mov jbomb, < jptr djn -1, # (CORESIZE*98)/100 ; calculated by the preprocessor i for 5 spl bomber&i, 0 rof jmp impgate, 0 gate dat 0,0 ; this will be changed every cycle after bombers are killed for 4 dat 0,0 rof impgate jmp 0, > gate ; this will be the only survivor of bombing dat 0,0 datbomb dat 0,0 i for 5 bomber&i mov datbomb, step+1 add #step, -1 jmp -2, 0 rof end