From: dak@vlsi.polymtl.ca (Pierre Baillargeon (Hiv91))
Subject: Some x-warriors
Organization: Ecole Polytechnique de Montreal
Date: Wed, 26 Aug 1992 22:12:07 GMT

  I've just started to write some warriors on the experimental hill, and since
I ben able to place some of them (as high as 3rd position at one time), I 
think it's time I post them (before they fall off :).

  My first program to make it is an `invader' type, spawning new process in
the enemy code.  It made it to the 17th position, but there is no way such a
warrior could do better since:

	* there is NO WAY you can analyse effectively the hill since opcodes
	  and operands cannot be separated.

	* Eric's article suggested very good ways to fool them.

The program first version was looking for anything that was NOT dat, spl or
jmp with absolute operand (dat x,y...).  The second version was looking for
one of many kinds of moves that are found in programs.  It was called Ghost:

;redcode-x
;name Ghost
;kill Ghost
;author Pierre Baillargeon

len	equ 8
dist	equ 125
field	equ 250+bomber-target

lab	dat 0,0
what	mov #0,#0
	dat 0,0

mod	add #618,#-2		; change location
	mov @mod,lab
	sub lab,lab
	cmp what,lab
	jmp mod,0
	spl @mod,0
	djn mod,#3

waiter	spl target,0		; start core clear
sleep	djn sleep,#0		; wait...
	jmp waiter,0		; redo clear

target	mov #250-len,target	; init bomb distance
bomber	mov bomb,<target	; bomb
	jmn bomber,target	; rebomb if not reached us
copy	mov <target,<dist	; now copy (bomb contains right value)
	jmn copy,dist-1		; finished copying ?
	jmp @dist-2,0		; next field
bomb	dat 0,len		; bomb contains program length
target	dat 0,0			; ze target pointer

	end mod


My most successful program to date is just an adaptation of a midly successful
program that I tried on the normal hill.  The trick used here is to use double
indirection to achieve a 2 bombs / 3 instructions ratio.  The first bomb use
the second as its offset.  So half the core is filled with spl, the other with
dat, and there a phase of 90o for every core loop.  It's Deep Green Sea:

;redcode-x verbose
;name Deep Green Sea
;kill Deep Green Sea
;author Pierre Baillargeon
;strategy  v1.00:  Very fast spl bombing, core clearing.
;strategy  v1.10:  Added some decoys.
;strategy  v1.11:  Found a bug in decoys...
;strategy  v1.20:  No more decoys !!!
;strategy  v1.30:  About twice faster.
;strategy  v1.41:  Back to 1.20.


len	equ 12
dist	equ 254
first	equ 126
delta	equ 126
amount	equ 118

shore	mov #len,#len		; init copy source
count	mov #amount,#amount	; init bombing count
	mov #first,bank		; init bomb-start location
sea	mov #dist,#dist		; init copy destination
green	mov algae,<bank		; two mov making double indirect
bank	mov shark,<first
	djn green,count
copy	mov <shore,<sea		; copy ourself
	jmn copy,shore
	jmp @sea,0
shark	dat 0,#delta		; distance between bombing
algae	spl 1,#delta

	end green

  The last warrior that I'll post didn't do well at all, but show a very small
core clear routine that works very well.  It basically an imp with a forward
bombing instruction.  If you want to protect your back with a mov x,-250,
you need 5 processes instead, and it does not offer a much better performance.

;redcode-x
;name turtle
;kill turtle
;author Pierre Baillargeon

	spl 1,4		; two instructions create 3 synchronised
	mov -1,0	; process with a useful offset as the B op.
	djn @-1,-1	; use B op. to spread process on 3 consecutive
			; instructions
	mov 1,2		; mov forward
	mov 1,2
	mov 1,250	; bombs away !

	end

  The previous program used the fact that a spl instruction does not use its
second operand.  A final thought:  here is an interesting self killing PIT:

pit	spl 0,0
	spl 0,0
	djn @pit,#0
	mov 1,>pit
	dat 0,0

Every 8000th times the djn is executed, a process falls through a slowly eat
the pit away... (BTW, a `pit' is where you make the enemy jump to in order to
immobilise all its process.  The figure of 8000 assume a core size of 8000).

--
"Pis Bourassa qui est toujours la.  Y'a pas d'remede contre le SIDA" - French B
"This is a mad house !" - Rosencrantz
...........................................................dak@info.polymtl.ca
Newsgroups: rec.games.corewar