From news-rocq.inria.fr!jussieu.fr!oleane!news.maxwell.syr.edu!ais.net!vixen.cso.uiuc.edu!uwm.edu!msunews!mooredav Mon Mar 2 10:44:02 1998 Article: 8472 of rec.games.corewar Path: news-rocq.inria.fr!jussieu.fr!oleane!news.maxwell.syr.edu!ais.net!vixen.cso.uiuc.edu!uwm.edu!msunews!mooredav From: mooredav@cps.msu.edu (David Matthew Moore) Newsgroups: rec.games.corewar Subject: pScout Date: 1 Mar 1998 19:00:09 GMT Organization: Michigan State University Lines: 123 Message-ID: <6dcb7p$kqi$1@msunews.cl.msu.edu> NNTP-Posting-Host: segula.cps.msu.edu X-Newsreader: TIN [version 1.2 PL2] X-MD5: f470015651be11442d2a22b47a466d8a I thought that it would be useful to explain a little bit more about the pspace-reading vampire that I just posted. First, here's a mini version: ;redcode-94 ;name pScout ;author David Moore ;assert 1 ;strategy use a vampire to find opponent's pspace location Pstore equ 123 step equ 1445 ; multiple of 5 fang jmp t1-(5+step), 5+step vamp mov @0, @fang add t1, fang jmz.a vamp, t2 ; know when opponent is trapped jmz.b #0, t2 ; search for last nonzero pspace stp.ab t2, #Pstore ; capture the prize! t1 spl #-step, #step t2 ldp.ab #0, #0 t3 dat {0, 0 end vamp ------------ HOW IT WORKS ------------ First, a note about the timing. Take a look at the trap code: t1 spl #-step, #step t2 ldp.ab #0, #0 t3 dat {0, 0 Suppose that one enemy process enters the trap at t1. Because of the self-splitting nature of the loop, it will split into three processes and the enemy will execute like this: t1 all other processes t2 t1 all other processes t3 t2 t1 all other processes t3 t2 t1 all other processes ... This guarantees that t3 execution is always followed by a t2 execution, and a t2 execution is always followed by a t1 execution. This is important because of what happens in between the execution of t3 and t2. t2 is supposed to hold a pspace location in the a-field and its contents in the b-field, but during the time between t3 and t2, the pspace location does not match its contents. Fortunately, such inconsistency will happen for at most one cycle, thanks to the self-splitting. Also, the execution of t1 gives the vampire time to read the correct cell/contents. Therefore, the vampire will _always_ read the trap correctly; there is no random factor from the splitting or from processes entering at different times. ------------- HOW TO USE IT ------------- 1. Always mod the result by PSPACESIZE (500). If all pspace is empty then the vampire will look at the 0th location last. It could get confused and report 7500 as the enemy's pspace location. 2. Preferably mod the result by PSPACESIZE-1 (499). If vampire is subject to a djn.f attack, it can incorrectly report -1 as the pspace location. 3. Try not to use it against paper! The problem is with papers that use the following code to copy: SPL @0, destination MOV }-1, >-1 The vampire's JMP lands on the paper's SPL instruction. This causes the paper to MOV stuff right over the trap, which can cause a false report of an enemy pspace sighting. One trick is to use pScout only after your paper loses. Scanners are much nicer to vamp than paper! ----------------------------------------------- WHAT WILL I DO WITH MY ENEMY'S PSPACE LOCATION? ----------------------------------------------- Again, you can try to brainwash with different numbers until you find a warrior that you would like to fight. Then keep brainwashing your opponent into that warrior. John K.W. pointed out that this can be done simply by filling his entire pspace with that magic number, so why bother to find the exact location? Perhaps it makes brainwashing warriors easier to write. In fact, there may be some "silver-bullet" programs that just aren't possible otherwise. Who knows? Maybe there will be a time for it in the future. Anyway, I'm done playing with this idea for now. See you in round 5! ----- David Moore mooredav@cps.msu.edu