Article 3216 of rec.games.corewar: Newsgroups: rec.games.corewar Path: news.cs.utah.edu!u.cc.utah.edu!math.utah.edu!news.math.utah.edu!morrell From: morrell@jeeves.math.utah.edu (Steven C. Morrell) Subject: Silk Paper Sender: news@math.utah.edu Date: Tue, 4 Oct 1994 19:52:47 GMT Organization: Department of Mathematics, University of Utah Message-ID: Lines: 65 Having become thoroughly disgusted with the C++ project I have been working on, I will spend some diversionary time telling everybody about B-Panama X, the world's *second* silk paper program. The first silk paper program was Silk Warrior by J. Pohjalainen a couple of months ago. I only saw the code for this program when it was posted to this newsgroup, so you may ask how I came up with silk paper independently. You may ask... The distinctive feature of silk paper is that it splits to the next copy before it copies itself there. This sounds suicidal at best, unless you remember that DAT statements don't kill processes until they are executed. Thus, the first process of the parent paper can copy an instruction to the child paper to execute just in time to keep the first process of the child from dying. The upshot is that you can write a *very* virulent paper program where the first instruction is the SPL instruction and the second instruction is the copy instruction. By the time a scanner has found a copy of your paper, your paper is already splitting off processes to another copy. And silk paper splits off processes so fast that a lot of SPL 0/JMP 1 bombs have to be dropped to slow down the breeding. In fact, I theorize that if the process limit was raised from 8000 to, say, 20,000 processes, SPL/JMP bombers wouldn't be very effective against silk paper. Carpet SPL 0- bombing seems to work more effectively, contributing to the success of Agony II on the hill. Writing silk paper is a lot trickier than it sounds. The first instruction will be the SPL instruction, but it has to contain the destination pointer too, because the first process of the child paper has to split off to the grandchild paper with only the first instruction available. But any kind of paper also needs the source pointer to be in the first instruction, or else it doesn't copy proprly. Fortunately for us, the hill lets us access both the A- and B-operands. The code so far: SPL dst,0 or SPL @0,dst The second instruction has to do the copying. Copy things backward, like traditional paper, and the split-off processes find themselves off the copy and therefore dead. Conversely, if you are going to foreward copy your paper, splitting before copying seems to be the only way to keep the split processes inside the copy of the paper. So we now have: SPL dst,0 SPL @0,dst MOV >-1,}-1 MOV }-1,>-1 Now all that needs to be done is the pointer reset and looping back to the SPL instruction. The simplest (but I doubt the most effective) way of doing this is to use a JMP and decrement the B-operand. For instance: SPL 1 ; Get three processes running coherently through the paper MOV -1,0 SPL @0,dst ; And here is the paper. MOV }-1,>-1 JMP -2,{-2 This is a full program and ties about 75% on the hill. It doesn't have a natural killing mechanism, but oh baby, how it breeds! Okay, so how did I figure it out? Well, I had been toying with forward copying paper for some time (for example, B-Panama IX, which is unpublished and lost) when J. Pohjalainen came up with Silk Warrior. I started thinking about paper again, and came up with B-Panama X. In the next post, I will get into the specifics of B-Panama X and give you some code. Steven Morrell morrell@math.utah.edu Article 3226 of rec.games.corewar: Newsgroups: rec.games.corewar Path: news.cs.utah.edu!u.cc.utah.edu!math.utah.edu!news.math.utah.edu!morrell From: morrell@jeeves.math.utah.edu (Steven C. Morrell) Subject: B-Panama X Sender: news@math.utah.edu Date: Thu, 13 Oct 1994 19:34:06 GMT Organization: Department of Mathematics, University of Utah Message-ID: Lines: 99 Here is the code for B-Panama X, finally. The stone is from Blue Funk 3, with an extra SPL at the beginning to keep up with the paper. Since the stone only needs to wipe out scanners, this is a bit of overkill. I mean, what are the chances that all of the paper is killed off and the stone is left intact? The paper is booted off from the decoy, which in retrospect seems like a waste of time. It is spaced so that the bomber hits the SPL @0 instruction for extra killing power against processes captured by the paper. The paper was supposed to be vampiric, but I have never seen the pit work right, so I think there's a bug in it. While testing all sorts of silk paper for this program, I found that the vampiric part added ten points to my score, so it must be doing something. Also, there are no fangs being dropped, because it hindered the excellent imp-ring killing code in the paper. So the pit in the paper is fall-into-it rather then hunt-you-out- and-throw-you-in. I wonder where the extra points are coming from. Here's how it does against everybody on the hill: Scimitar 54/23/23 I'm with stupid. 47/ 7/46 Delivery 45/45/10 SJ-4 44/17/39 Iron Gate 1.5 41/38/21 Torch t8 40/18/42 Agony II 38/46/16 Blue Funk 33/ 1/66 Blue Funk 3 33/ 8/59 Sasami 32/ 4/64 Unknown (Old) 26/60/14 ki-h-d/d 18/ 0/82 Unknown (New) 16/ 1/83 Cannonade 13/ 2/85 Bremstone 2.X 12/ 3/85 Rude Wind 12/ 3/85 Aeka 11/ 2/87 Phoenix 1.2 9/ 0/91 Silk Warrior 1.4 2/ 3/95 And here it is: ;redcode-94 verbose ;name B-Panama X ;kill test ;author Steven Morrell ;strategy Better Stone / Silk (?) Paper org boot step equ 3044 stone spl #0,>-10 SPL #-step,-step,step+1 ADD -2,-1 DJN -2,-1 mov 5,>-2 jmp -3,{-3 spl 1,0 mov 2,<-1 djn.f -2,>-6 dat <2667,<5334 ;macro for 70 dat Lines: 60 I posted this a while back, but it's doing well still, so here is B-Panama X. ;redcode-94 verbose ;name B-Panama X ;kill test ;author Steven Morrell ;strategy Better Stone / Silk (?) Paper org boot step equ 3044 stone spl #0,>-10 SPL #-step,-step,step+1 ADD -2,-1 DJN -2,-1 mov 5,>-2 jmp -3,{-3 spl 1,0 mov 2,<-1 djn.f -2,>-6 dat <2667,<5334 ;macro for 70 dat