Path: ibmpcug!penny.ibmpcug.co.uk!pipex!howland.reston.ans.net!gatech!news-feed-1.peachnet.edu!ukma!nntp.memphis.edu!nntp.rhodes.edu!harlie.mathcs.rhodes.edu!graham Newsgroups: rec.games.corewar Subject: QCmp-Hunter Message-ID: <1995Feb28.174529.2031@rhodes> From: graham@harlie.mathcs.rhodes.edu (Randy Graham) Date: 28 Feb 95 17:45:28 -0500 Nntp-Posting-Host: harlie.mathcs.rhodes.edu X-Newsreader: TIN [version 1.2 PL2] Lines: 119 Ok, here's my attempt at a QCmp program. I end up copying myself away (Cmp-Hunter v1.2) and starting that. While I am open to suggestions, I am more posting this as a way to give new folks an idea of how to set up a quick scan with sne/seq lines. I still need to work in figuring out optimal scan locations, but that will come in time I imagine. Right now, I do marginally better vs. the imps I have access to, but significantly worse against the likes of Rave or Charon. I have tried scanning a constant distance apart (QDIFF between each), and a small step within a line (QSTEP), a large step between lines (QDIFF*2). This one obviously has QSTEP scanning. That way I can just plaster the whole range if I find something. Using QDIFF*2 I had to check if *a or @b was different and bomb the correct location. By the way, anyone wanting the latest Cmp-Hunter, just pull the last few lines from adder to fini. This is exactly my 94b warrior (still miss the real 94 hill by a couple of points). Anyone with questions, feel free to contact me. I just learned Quick-scans last week, but I'll be glad to share my knowledge with anyone wanting it. --------[Snip, Snip]--------------------------------------------- ;redcode-b ;Name Qcmp-Hunter v0.5 ;Author Randy W. Graham ;assert 1 ;strategy OK, here's an attempt at a qscan Cmp-Hunter. OPT equ 44 ;mod 4 LEN equ (fini-adder) DIFF equ 13 BOMBS equ DIFF+setup-adder MOVETO equ B03-BACK-LEN-1 ;where we move to QDIFF equ 88 QSTEP equ 13 A01 equ 200 A02 equ A01+(QDIFF*4) A03 equ A01+(QDIFF*8) A04 equ A01+(QDIFF*12) A05 equ A01+(QDIFF*16) A06 equ A01+(QDIFF*20) A07 equ A01+(QDIFF*24) B01 equ A01+(QDIFF*28) B02 equ A01+(QDIFF*32) B03 equ A01+(QDIFF*36) B04 equ A01+(QDIFF*40) B05 equ A01+(QDIFF*44) B06 equ A01+(QDIFF*48) B07 equ A01+(QDIFF*52) C01 equ A01+(QDIFF*56) C02 equ A01+(QDIFF*60) C03 equ A01+(QDIFF*64) C04 equ A01+(QDIFF*68) C05 equ A01+(QDIFF*72) C06 equ A01+(QDIFF*76) C07 equ A01+(QDIFF*80) BACK equ 15 QBOMB equ BACK+BACK ;qscan scanner qscan for 7 sne.i A&qscan, A&qscan+(QSTEP) seq.i A&qscan+(QDIFF*2), A&qscan+(QDIFF*2+QSTEP) mov.a #A&qscan-target, target rof ;mov.a makes sure to move so we still point at same location jmn.a gobomb, target qscan for 7 sne.i B&qscan, B&qscan+(QSTEP) seq.i B&qscan+(QDIFF*2), B&qscan+(QDIFF*2+QSTEP) mov.a #C&qscan-target, target rof jmn.a gobomb, target qscan for 7 sne.i C&qscan, C&qscan+(QSTEP) seq.i C&qscan+(QDIFF*2), C&qscan+(QDIFF*2+QSTEP) mov.a #C&qscan-target, target rof jmz.a moveme, target ;if we haven't found anything gobomb add.ab target, target ;get two pointers set up sne.i *target, @target ;if these differ, use them add.i nope, target ;else, add our offsets qbomb mov.i spltrap, }target ;lay carpet on a-field djn.b qbomb, #QBOMB moveme spl 1, <2667 ;2 instructions leave mov.i -1, #0 ;3 instructions leave spl 1, <2667 ;6 instructions leave spl 1, <2667 ;12 instructions leave mov.i }datsite, >datsite djn.b nope, #LEN spl.a cmper+MOVETO-1, >fini+1 clear mov.i traps, datsite ;hide pointers to self mov.i traps, -2 nope dat.f >(QDIFF*2), >(QDIFF*2) target dat.f #0, #QSTEP datsite dat.f adder, MOVETO ;the real cmp-hunter adder add.f spltrap, cmper ;increment pointers cmper cmp.i adder-DIFF-OPT, adder-OPT ;small scan distance slt.ab #LEN+BOMBS, cmper ;don't bomb ourself unless @adder djn.i adder, <-381 ;need to check -381 for better value setup mov.ab #BOMBS, traps ;set up djn line mov.i spltrap, }cmper ;bomb a-field traps djn.b -1, #0 sub.a #BOMBS, cmper ;reset scan line a-field jmz.i adder, adder-1 ;fall out when we bomb ourself spltrap spl.a #0-OPT, <0-OPT ;here and datadd after sweep make gate dosweep mov.i 1,