From news-rocq!jussieu.fr!oleane!newsfeed.icl.net!newspeer.clara.net!news.clara.net!easynet-tele!easynet.net!newspeer1.nac.net!newspeer.monmouth.com!nntp2.deja.com!nnrp1.deja.com!not-for-mail Mon Sep 6 18:04:41 1999 Article: 10620 of rec.games.corewar Path: news-rocq!jussieu.fr!oleane!newsfeed.icl.net!newspeer.clara.net!news.clara.net!easynet-tele!easynet.net!newspeer1.nac.net!newspeer.monmouth.com!nntp2.deja.com!nnrp1.deja.com!not-for-mail From: Ben Ford Newsgroups: rec.games.corewar Subject: Quick Thinking Date: Mon, 06 Sep 1999 02:00:31 GMT Organization: Deja.com - Share what you know. Learn what you don't. Lines: 193 Message-ID: <7qv77r$q66$1@nnrp1.deja.com> References: NNTP-Posting-Host: 207.170.76.163 X-Article-Creation-Date: Mon Sep 06 02:00:31 1999 GMT X-Http-User-Agent: Mozilla/4.5 [en] (WinNT; U) X-Http-Proxy: 1.0 x29.deja.com:80 (Squid/1.1.22) for client 207.170.76.163 X-MyDeja-Info: XMYDJUIDbenford Xref: news-rocq rec.games.corewar:10620 > With the round robin finished we came to the four Warrior Knock Out! > As we can see, Ben Ford's entry "Quick Thinking" is clearly the odds > on favorite having scored so highly in the round robin. Macrae and > Moore both entered "dumber" programs that cleared core with sequential > clears, hoping to trade score for speed that might help in the Knock > Out portion of the tourney. Wilkinson's "Mine v0.3" was a jmp > stunner/scanner with bootstrap. >From the scores I wouldn't of said that I was the favorite coming out. I just happened to be setting my score higher that other people were. In fact, I had lost to 2 of the 3 other finalists. > The first battle was between Ben Ford's "Quick Thinking" and David > Moore's "Starving Hacker". Ben had lost in the round robin to > "Starving Hacker" and was looking to take the battle to Moore's > quicker program. Unfortunately for Ben, Moore's attack was too fast > and he fell. Having easily dominated the round robin, "Quick > Thinking" was ironically beaten by a quicker program. (Note: Ben > had, in my opinion, on of the best programs written and might had > taken it all had the rules been slightly different.) Yeah, its too bad the warriors didn't fight 200 rounds against each other and added up the score. Then I would of just had to win one round to beat those guys =). I had figured that q-scanning would be the best way to start off, giving an extra burst of speed. Since the main scanner was using a specialized attack, I figured it would work out best if the qscanner just set the scanners pointers. The qscan also provides a nice big decoy for other scanners to bite on that I ignore. in retospect the qscanner might not of been the best idea since it is likely to find the RedOS instead of the other warrior. I went with an HSAish scanner since its about the fastest scanner out there and I could easy modify its attack to be intelligent. I used the smart route that the test program used, finding the top of the code and putting the info there. The HSA scan pattern helps out a bit here since it will never have to scan backwards for too long. The HSA carpet then disables any code after the regiesters. I figured it would work ok. At first my biggest worry was a blur-type scanner that would drop spl #0, 0 bombs that would slow me down to 50% while scanning the carpet. Here is the code. ;redcode-94 ;name Quick Thinking ;author Ben Ford ;assert 1 ;strategy qscan -> HSAish scanner ;strategy ;strategy instead of bombing, qscan sets starting values for scanner ;strategy scanner based on HSA, added part to set my score properly ;strategy also never switches to dat-bombing (stun everything but me!) ;strategy ;strategy beats test warrior (and simple improvements) 80%+ ;strategy better than nothing, I suppose someone could try to take ;strategy advantage of 'flaws' in the hsa engine PLAYER EQU 2 ; change this number to either 1 or 2, depending ; on which position it should be looking for. ; ----- HSA-ish scanner ----- ; use +/- 10 for constants to prevent increments/decrements from hurting score ; hopefully won't lose out to someone using +/- 1 c1 equ (20*PLAYER-30) c2 equ (30-20*PLAYER) slen equ (qend-sptr+4) sptr dat $ qs, $ qs ; widely-spaced pointers dat $ 0, $ 0 dat $ 0, $ 0 dat $ 0, $ 0 dat $ 0, $ 0 pos2 spl # c2, $ c2 pos1 spl # c1, $ c1 mov sbmb, >sptr kill jmn.f -1, @sptr scan sub.x # -12, sptr ; increment and look sne *sptr, @sptr sub.f scan, sptr ; increment and look qhsa jmn.f self, @sptr jmz.f scan, *sptr swap mov.x sptr, sptr ; swap pointers for attack self slt.ab #slen, sptr ; self-check jmp scan, $ 0 jmn.f $ 0, sptr mov pos1, >sptr mov pos2, >sptr jmp kill, $ 0 ; go to attack sbmb spl # 0, $ 0 for 17 dat $ 0, $ 0 rof ; ----- decoy ----- ; put a copy of the top of RedOS to fool other warriors DAT.F $ 0, $ -45 ; <-- this is a pointer to the end of code. DAT.F $ 3, $ 5 ; <-- this represents the version number. DAT.F $ 0, $ 0 ; <-- this is the input register for commands. DAT.F $ 1, $ 1 ; <-- this is the register for warrior 1 DAT.F $ 1, $ 1 ; <-- this is the register for warrior 2. LDP.AB # 0, # -1 ; <-- this is the start of code for RedOS. ; ----- q-scan ----- qf equ sptr qs equ 100 qd equ 3996 qo equ (qi*qr-10) qi equ 7 spl # 14, < 10 ; A,D qtab spl # 7, < 4 ; B,E qbmb dat # 19, { 1 ; C qscan seq qd+qf+14*qs, qf+14*qs ; A jmp qfas, {qfas seq qd+qf+35*qs, qf+35*qs ; B*(E+1) jmp qslo, >qtab seq qd+qf+52*qs, qf+52*qs ; (A-1)*E djn.a qslo, {qfas seq qd+qf+70*qs, qf+70*qs ; B*D jmp qslo, {qslo seq qd+qf+9*qs, qf+9*qs ; D-1 djn.b >qfas, {qslo seq qd+qf+24*qs, qf+24*qs ; (B-1)*E jmp qslo, {qtab seq qd+qf+7*qs, qf+7*qs ; B jmp qfas, {qd+qf+7*qs+qi seq qd+qf+21*qs, qf+21*qs ; B*(E-1) jmp qslo, qfas, >qtab seq qd+qf+18*qs, qf+18*qs ; (B-1)*(E-1) djn.f qslo, qtab seq qd+qf+3*qs, qf+3*qs ; E-1 jmp >qfas, qfas, {qslo seq qd+qf+8*qs, qf+8*qs ; B+1 jmp qfas, }qtab seq qd+qf+63*qs, qf+63*qs ; B*(D-1) djn.b qslo, {qslo seq qd+qf+6*qs, qf+6*qs ; B-1 jmp qfas, {qtab seq qd+qf+19*qs, qf+19*qs ; C jmp qfas, }qfas seq qd+qf+4*qs, qf+4*qs ; E jmp >qfas, {qd+qf+4*qs+qi seq qd+qf+57*qs, qf+57*qs ; C*(E-1) djn.b qslo, }qfas seq qd+qf+1*qs, qf+qs ; 1 jmp qfnd, {qd+qf+qs+qi qslo mul.b qtab, sptr ; decode qfas mul.ab qtab, @qslo qfnd mov.ba sptr, sptr add # qd, sptr qend jmp qhsa, <1234 end qscan Sent via Deja.com http://www.deja.com/ Share what you know. Learn what you don't.