
Take a look a the following redcode instructions:

	MOV	#100, 1

	This is the '94 equivalent of the common imp (MOV 0, 1).
	By choosing the first value for this instruction at random,
	and using it as an imp-spiral instead of a common imp,
	you make it impossible for imp-spiral scanners like Iron Trap
	to function effectively.


	SPL	#732, <-17

	This instruction functions exactly like SPL 0.  It can be used
	very effectively in a SPL/JMP bomber, or to make your core
	clearing code more robust.


	JMP	#201, <-10

	Anyone who has seen my source code to Distance or Fast Food should
	recoginize this statement.  It is the '94 equivalent to a "wimp".
	If you have a program that generates a lot of processes, you can 
	put this statement (with one process) somewhere else in the code
	as a defense in case your main code stops running.  In addition, if
	this instruction is the only one you have left, it will stop 
	any "standard" imp-spirals your opponent still may have.





         Opcode                  A-mode  B-mode  modifier
         ------------------------------------------------
         DAT                     #$@<>   #$@<>   F
         MOV,CMP                 #       #$@<>   AB
                                 $@<>    #       B
                                 $@<>    $@<>    I
         ADD,SUB,MUL,DIV,MOD     #       #$@<>   AB
                                 $@<>    #       B
                                 $@<>    $@<>    F
         SLT                     #       #$@<>   AB
                                 $@<>    #$@<>   B
         JMP,JMZ,JMN,DJN,SPL     #$@<>   #$@<>   B
         ------------------------------------------------





	Imp-Ring - A minimal Imp-Spiral.
        	    d        EQU (coresize+1)/3
	            A        MOV 0,d   ; copy self to B
        	    B        MOV 0,d   ; copy self to C
	            C        MOV 0,d   ; copy self to A+1

	Imp-Spiral - An Imp-like program with two or more processes supporting
	   each other.  A three-point spiral, with six processes running in
	   this sequence:
	            d        EQU (coresize+1)/3
        	    A        MOV 0,d   ; copy self to B
	            B        MOV 0,d   ; copy self to C
        	    C        MOV 0,d   ; copy self to A+1
	            A+1      MOV 0,d   ; copy self to B+1
        	    B+1      MOV 0,d   ; copy self to C+1
	            C+1      MOV 0,d   ; copy self to A+2

It is possible to stop any of the above mentioned imp-spirals by using an
imp-gate such as the following:

              start   SPL.B   0, <-10
                      DAT.B   <-11-2668, <-11

(Simply remove the ".B" modifiers if you are using the '88 standard.)

This code will kill any "2668" step imp-spiral, but could be over-run by an
imp-spiral with a different step ... such as a "1144" (7 point) imp-spiral.
In fact, to the best of my knowledge, it is _impossible_ to use the '88 (or
current '94) standard to create an imp-gate that will stop all possible
imp-spiral combinations.


However, with the current draft of the '94 standard, there are other options
available instead.  The imp-gating method I have had the most success with is
by using the ">" operand to continuously increment the B-field of a given
location in the core.  This causes the imp-spiral to move an instruction
past the point where it is supposed to, thus leaving a gap in the imp-spiral.

For an example of this technique, take a look at the following imp-gate:

              start   SPL.B   0, >-20
                      DAT.B   <-11, >-21

The location twenty instructions before "start" is continually being
incremented, so any "standard" imp-spirals will be killed here.  However, if a
gate-crashing imp-spiral gets past this location, it will also need to get
past the location ten instructions before "start", which is being decremented
every other turn.  Since the gate-crashing imp-spiral will tend to be quite
fragile when it reaches the second location, the decrementing will usually be
enough to finish it off.







;redcode
;name Agony 3.1
;author Stefan Strack
;strategy Small-interval CMP scanner that bombs with a SPL 0 carpet.

CDIST   equ 12
IVAL    equ 42
FIRST   equ scan+OFFSET+IVAL
OFFSET  equ (2*IVAL)
DJNOFF  equ -431

scan    sub incr,comp
comp    cmp FIRST-CDIST,FIRST
        slt #incr-comp+CDIST+(bptr-comp)+1,comp
        djn scan,<FIRST+DJNOFF
        mov #CDIST+(bptr-comp)+1,count
        mov comp,bptr
bptr    dat #0
split   mov bomb,<bptr
count   djn split,#0
        jmn scan,scan
bomb    spl 0
        mov incr,<count
incr    dat <0-IVAL,<0-IVAL

        end comp

The first four instructions scan for enemy code, comparing 12 
instructions apart. If a difference was found, a bomb carpet is laid, 
starting 4 addresses above the B-address and ending with the 
A-address. This class of CMP-scanner wastes a lot of time bombing 
decremented addresses or decoy code, and therefore loses a lot 
against stone-type bombers. You can decrease the CMP-distance of 12 
to cut down on the time spent laying the carpet, but the scan pattern
becomes quickly sub-optimal, especially against larger warriors.
Mintardjo was able to shorten the bomb carpet without shortening the
CMP-distance by decrementing the 'cmp' instruction directly. His
warrior "Medusa's" is however one line longer than Agony, because the
pre-decrement misses bombing the B-address, which therefore has to be
bombed with a separate instruction:

;redcode
;name Medusa's v2.1
;author Mintardjo & Stefan

CDIST   equ 12
IVAL    equ 28
FIRST   equ scan-OFFSET+IVAL
OFFSET  equ 5324

scan    sub data,comp
comp    cmp FIRST-CDIST,FIRST
        slt #data-comp+CDIST+1,comp
        djn scan,<FIRST+163
        mov #CDIST-1,count
split   mov bomb,<comp
count   djn split,#0
        add #CDIST-1,comp
        jmz scan,scan-1
bomb    spl 0, <0-IVAL+1
incr    mov data, <bomb-1
        jmp incr, <0-IVAL-1
data    DAT <0-IVAL, <0-IVAL

        end comp

Here is where ICWS'94's _post_-increment comes into play: we can now
use the 'cmp' instruction as a pointer, and still bomb everything
including A- and B-address with a 2-line loop. Since the B-address is
now incremented, it must initially be lower than the A-address. So we
don't bomb our one code we now need to test the A-address with the
slt.A instruction. Adding the .F modifier to the DJN makes it both
safer (we fall thru only if both A- and B-numbers are 1) and more
effective. Finally, we dispose of the last DAT instruction by
combining the scan increments with the SPL instruction. As explained
in the first issue, SPL #n is executed like SPL 0. Here the full code:

;redcode-94
;name Rave 3
;author Stefan Strack
;strategy Carpet-bombing scanner based on Agony and Medusa's

CDIST   equ 12
IVAL    equ 42
FIRST   equ scan+OFFSET+IVAL
OFFSET  equ (2*IVAL)
DJNOFF  equ -431
BOMBLEN equ CDIST+2

        org    comp

scan    sub.f  incr,comp
comp    cmp.i  FIRST,FIRST-CDIST        ;larger number is A
        slt.a  #incr+1-comp+BOMBLEN,comp  ;compare to A-number
        djn.f  scan,<FIRST+DJNOFF       ;decrement A- and B-number
        mov.ab #BOMBLEN,count
split   mov.i  incr,>comp               ;post-increment
count   djn.b  split,#0
        sub.ab #BOMBLEN,comp
        jmz.a  scan,scan-1
incr    spl.b  #-IVAL,<-IVAL
        mov.i  1,<count






A similar method that can be used with the '94 standard is to use your
core-clearing routine to "confuse" the core instead.  Take a look at the
following code:

	clear	spl.B	#0, <-20	; Equivalent to: SPL.B 0, <-20
		mov.I	2, <-11		; Overwrite the core
	confuse	djn.F	-1, >1		; Confuse the core
		dat.F	<-21, #10	; Give a pointer to work with

The first two lines are the '94 equivalent of a standard core-clear.
The "SPL 0" line generates processes, which the "MOV" uses to fill the
core with "DAT" instructions.

The last two lines are used to "confuse" the core.  The "DJN" instruction
will decrement both the A and B-field values of the instructions as it
proceeds forward through the core.  This decrementing is usually enough to
keep any program it meets from working correctly, so the 
standard part of the core-clear (which is working its way backwards
through the core) will have no problem completely killing the opponent when
it gets to it.  Since the "MOV" instruction in the core-clear gets the
processes created by the "SPL 0" before the "DJN" instruction does, it will
always complete first -- so the confusion will never reach the core-clear
itself.

This technique has several advantages over a two-pass core-clear.
In addition to being at least twice as fast, it is also easy to implement
and fairly rugged.  In fact, the "confuse" line can be bombed by a "DAT"
statement and the core-clear will still work.

There are several attributes of using this core-clearing method that cause
it to work well against imp-spirals as well.  The multiple processes
running during the clear will give your program a tie if the core-clear
is over-run before it has completed, and the imp-gate at the end will
(usually) stop imp-spirals if any remain when the core-clear is completed.

An important thing to notice is that the location pointed to by the
"confuse" line has a positive value.  This is because the "confusion" will
not work correctly if this value is zero.  (The decrementing and incrementing
cancel each other out.)








;redcode-94x
;name Request-55440
;author Brant D. Thomsen
;strategy '94 Vampire
;strategy The latest program in my "quest"
;strategy to yield less wins to anti-vampiric programs.
;strategy Submitted: @date@

step	equ	9719
init	equ	(pit+1+step)

gate	equ	(jump-12)
decoy	equ	(gate-1+step)

FOR 132
	dat	#start*10, #1	; Provide a large decoy.
ROF

start	mov	jump, <dist

	sub	#jump-adder-1, dist

	mov	adder, <dist

	sub	#adder-pit-5, dist

	mov	pit+4, <dist
	mov	pit+3, <dist
	mov	pit+2, <dist
	mov	pit+1, <dist
	mov	pit, <dist

	sub	#pit-vamp-4, dist

	mov	vamp+3, <dist
	mov	vamp+2, <dist
	mov	vamp+1, <dist
	mov	vamp, <dist
	spl	@dist, <10000	; Start the vampire

	sub	#vamp-help-2, dist

	mov	help+1, <dist
	mov	help, <dist
	spl	@dist, <20000	; Send 2 processes to "help" so that will
	spl	@dist, <30000	; execute "MOV" once cycle.

	sub	#help-wimp-1, dist

	mov	wimp, <dist
	spl	@dist, <40000

	sub	#10000, dist	; Erase record of where boot-strapped.
dist	dat	#15501		; Then kill the process.


	; The following is the code for the program.
	; Spacing (for DATs between segments) is computed automatically.

jump	jmp	@decoy-init, init

FOR 8
	dat	#start*10, #1
ROF

	; Wimp is necessary so will still have a process when pit dies.
	; Runs no risk of starvation since no SPL in it.

wimp	jmp	#0, <gate

FOR 3
	dat	#start*10, #1
ROF

pit	mov	@8, <gate-1
	spl	#0, <gate
	spl	-2, <gate
	spl	-2, <gate
	djn.F	pit, >adder-2

FOR 9
	dat	#start*10, #1
ROF

help	mov	#pit-decoy, decoy
	jmp	help, <gate

FOR 6
	dat	#start*10, #1
ROF

adder	dat	<-step, <step

FOR 3
	dat	#start*10, #1
ROF

vamp	spl	#0, <gate
move	mov	@0, @jump
	add	adder, @move
	djn.F	-2, <-step

	end	start







;redcode-94
;name Imp-Spiral Finder
;author Brant Thomsen
;strategy Launch the smallest possible imp-spiral for any coresize < 90090
;macro

boot	equ	150


imp	mov.I	#0, 0		; Will copy value here later.

find	mov.B	<d2, #0		; Get the value to test.
	mul.AB	@d2, find	; See what the result would be.
	djn.B	find, find	; If result != 1, then try next value.

launch	mov.B	@d2, imp	; Put the value in the imp.
	mov.I	imp, imp+boot	; Move the initial imp-spiral instruction.

	; Begin to generate processes.

	spl.F	2
for 5
	spl.F	1
rof

	; Should have 48 processes here.

	spl.F	2		; Launch an imp-spiral using JMP/ADD method.
	jmp.F	@0, imp+boot	; Nice since don't need step size in advance.
	add.F	imp, -1


	; These are the test values to use.
	; Notice that only prime numbers are used.

	dat.F	17, (d17 * CORESIZE + 1) / 17	; Needed for size 30030
	dat.F	17, (d17 * CORESIZE + 1) / 17	; Needed for size 60060
d17
for 12
	dat.F	13, (d13 * CORESIZE + 1) / 13
rof
d13
for 10
	dat.F	11, (d11 * CORESIZE + 1) / 11
rof
d11
for 6
	dat.F	7, (d7 * CORESIZE + 1) / 7
rof
d7
for 4
	dat.F	5, (d5 * CORESIZE + 1) / 5
rof
d5
for 2
	dat.F	3, (d3 * CORESIZE + 1) / 3
rof
d3	dat.F	2, (d2 * CORESIZE + 1) / 2

d2	end	find		; This instruction is a DAT.F 0, 0
				; It is used at the pointer to the
				;  current test value.




;redcode-94 quiet
;name Torch
;author P.Kline
;strategy very rapid incendiary bombing, core-clear & gate
;macro

step     equ 73
count    equ 1500

gate     dat   <-step+1,<-step
     for 21
	 dat   0,0
     rof
sp       spl   #0,<-step             ; spl half of the incendiary
in       add   #step+step,msm        ; |
msm      mov   sm,>tgt-(step*count)  ; | these 3 execute in reverse order!
msp      mov   sp,@msm               ; |
tgt      djn.f in,>3157              ; gets bombed with spl to start clear
clr      mov   gate,<-13
cp       djn.f clr,>3                ; forward decrement while clearing
     for 32
         dat   0,0
     rof
sm       mov   @0,>step              ; mov half of the incendiary
	 end   sp


This program has a bomb that looks like this:

    sm  mov  sp, >sp
    ...
    sp  spl  #0, <sm+1


As processes execute the MOV statement, they copy the SPL instruction
progressively through the core, starting with the location immediately
following the MOV.  Thus, the more processes there are that execute the MOV
statement, the longer the line of SPL instructions (the carpet) will be.

If this bomb were executed using in-memory evaluation, then the length of the
SPL carpet would always be equivalent to the number of times the MOV
instruction were executed.  However, with in-register evaluation, something
interesting happens when the MOV instruction tries to overwrite the SPL
instruction it uses as a pointer.  Because of the way the values are stored
in the registers, the increment is lost when the SPL instruction is copied
over itself.  Thus, the SPL instruction's B-field stays at 0 and the
carpet never progresses beyond it -- very effectively reducing the threat
of having the enemy capture your own code with the carpet it made after being
bombed.

You get a very similar effect with the DJN.F instruction at "cp".  If the
instruction 3 locations beyond it has a B-value of 0, the DJN stream never
progresses beyond that instruction.  However, unlike the bomb mentioned
earlier, I believe this is the same behavior you would achieve if using an
evaluator with _true_ in-memory evaluation.  (On Stefan Strack's CoreWar Pro,
you get a different interesting effect instead.  The "post-increment" is
performed _before_ the DJN, causing the DJN to bring it back to 0 and drop out
of the loop.)  If nothing else, ambiguities such as this one are very
effective at pointing out the advantages of including actual code for a
corewar emulator in the '94 standard -- it allows us to determine exactly what
a piece of code should behave like.  (I found lines 511-561 and lines 750-1416
[section 5.6] of the February 2 draft of the standard to be very helpful when
working on this issue's hint.  I'd recommend going over them if you would like
to know more about exactly how instructions are evaluated.)





;redcode-94
;name Insight v1.0
;author Brant D. Thomsen
;strategy Stone/imp-spiral
;strategy Uses A-field indirection
;strategy Submitted: @date@
;assert CORESIZE == 8000

step	equ	3039
init	equ	step+1
gate	equ	-12
impstep equ	2667

cdist	equ	CORESIZE / 22

	dat.A	#1, #1	; Large decoy to slow DJN streams,
	dat.A	#1, 1	; while still remaining unique
	dat.A	#1, @1	; in case of CMP scanners.
	dat.A	#1, <1
          .
          .
          .
	dat.BA	1, >1
	dat.BA	1, *1
	dat.BA	1, {1
	dat.BA	1, }1

stone	spl	#gate, <gate
loop	mov	data, *init	; "data" placed here by last hit,
				; to create a "perfect" imp-gate.
	add	#step, loop
	djn.F	loop, @loop	; Last hit is actually here
data	dat.F	<gate, #0

start	mov	stone + 4, @boot
	mov	stone + 3, <boot
	mov	stone + 2, <boot
	mov	stone + 1, <boot
	mov	stone + 0, <boot

;Binary imp launch
; 3 point, 10 processes -- generated by bimp

spiral	spl	16,			{cdist * 1	; Use the B-field of
	spl	8,			{cdist * 2	; the SPL and JMP
	spl	4,			{cdist * 3	; instructions to
	spl	2,			{cdist * 4	; decrement locations
	jmp	imp + 0,		{cdist * 5	; in hopes of an early
	jmp	imp + impstep,		{cdist * 6	; advantage
	spl	2,			{cdist * 7
	jmp	imp + 2 * impstep,	{cdist * 8
	jmp	imp + 1,		{cdist * 9
	spl	4,			{cdist * 10
	spl	2,			{cdist * 11
	jmp	imp + impstep + 1,	{cdist * 12
	jmp	imp + 2 * impstep + 1,	{cdist * 13
	spl	2,			{cdist * 14
	jmp	imp + 2,		{cdist * 15
	jmp	imp + impstep + 2,	{cdist * 16

; Jump to stone
	spl	@boot,			{cdist * 17
	spl	@boot,			{cdist * 18

	spl	2,			{cdist * 19
	jmp	imp + 2 * impstep + 2,	{cdist * 20
	jmp	imp + 3,		{cdist * 21

imp	mov.I	#-100, impstep

	dat.F	#1, #1
	dat.F	1, 1

boot	dat.F	#0, #2550	; Bootstrapping distance
				; Will be overwritten by the imp-spiral

	end	start

The stone is certainly nothing to get excited about.  The bombs are moved to
the location being referenced by the location the stone is pointing at, in the
hope that it will point to something important.  This is usually a safe
gamble, although it is not always the case.  In fact, the imp I use for the
imp-spiral deliberately has a non-zero A-value to keep me from bombing it.





;redcode-94
;name     Ryooki
;kill     Ryooki
;author   T.Hsu
;strategy Just a simple paper
;assert   CORESIZE == 8000 && MAXLENGTH >= 100 && VERSION >= 60
;macro
;-----------------------------------------------------------------------------
;  1.0  Just an imp killing paper.
;  1.1  Use nop and jmz.f in the paper.
;  1.2  Use "mov 0,}0" instead of nop.  Use "spl @nxt" instead of "spl nxt".
;  1.3  Larger due to anti-vampire code.  Use labels instead of numbers.
;  1.4  Use "nop >0,0" instead of "mov 0,}0".

	    org     boot_paper

nxt_paper   equ     -3365

boot_paper  spl     1 ,0
	    spl     1 ,0
	    mov.i   -1,#0

p_src       nop     >0        ,0            ; B-fld holds source
p_cpy       mov.i   <p_src    ,{p_dst
p_dst       spl     @nxt_paper,>800         ; A-fld holds destination
	    mov.i   p_bomb    ,{p_dst       ; anti-imp  instruction
	    mov.i   p_bomb    ,}25          ; anti-vamp instruction
	    jmz.f   *p_cpy    ,*p_cpy
p_bomb      dat     <2667     ,<2667*2      ; bomb designed to kill imps

cnt         for     90
	    dat     0,0
	    rof



What I came up with, after quite a bit of trial and error, was the vector
launched imp.  A vector launch boots an imp in O(2*N+C) cycles and is
O(log2(N-1)+(N/2)+1) in length.  The first example below is a "perfect"
vector launch, i.e., it is exactly as fast as a binary launch and yet it is
smaller and easier to read.  The second example shows an alternate method
of vector launching a smaller imp.
------------------------------------------------------------------------------
;redcode-94
;name   Vector
;author T.Hsu

imp_sz  equ     2667

boot    spl     1      ,#0
	spl     1      ,#0
	spl     <0     ,#vector+1
	djn.a   @vector,#0

imp     mov.i   #0,imp_sz

	jmp     imp+imp_sz*7,imp+imp_sz*6   ; normally this is in a for/rof
	jmp     imp+imp_sz*5,imp+imp_sz*4   ; loop, but I wanted to make the
	jmp     imp+imp_sz*3,imp+imp_sz*2   ; order of the vectors obvious
vector  jmp     imp+imp_sz  ,imp

	end     boot
------------------------------------------------------------------------------
;redcode-94
;name   Single Vector
;author T.Hsu

imp_sz  equ     2667

	dat     0      ,#imp+imp_sz*3
boot    spl     1      ,#imp+imp_sz*2
	spl     1      ,#imp+imp_sz
vector  djn.a   @vector,#imp

imp     mov.i   #0,imp_sz

	end     boot



;redcode
;name Quick-Scan '88 Prototype
;author Brant D. Thomsen
;strategy Add this to the front of your warrior,
;strategy  and see if it improves your score.
;assert CORESIZE == 8000

space   equ     (8000/81)       ; Step when scanning for code.
qbomb   equ     6               ; Step when bombing whatever we found.

scan    cmp     space*1+bottom, space*41+bottom
	mov     #space*1+bottom-found, found
	cmp     space*2+bottom, space*42+bottom
	mov     #space*2+bottom-found, found
	cmp     space*3+bottom, space*43+bottom
	mov     #space*3+bottom-found, found
	cmp     space*4+bottom, space*44+bottom
	mov     #space*4+bottom-found, found
	cmp     space*5+bottom, space*45+bottom
	mov     #space*5+bottom-found, found
	cmp     space*6+bottom, space*46+bottom
	mov     #space*6+bottom-found, found
	cmp     space*7+bottom, space*47+bottom
	mov     #space*7+bottom-found, found
	cmp     space*8+bottom, space*48+bottom
	mov     #space*8+bottom-found, found
	cmp     space*9+bottom, space*49+bottom
	mov     #space*9+bottom-found, found
	cmp     space*10+bottom, space*50+bottom
	mov     #space*10+bottom-found, found
	cmp     space*11+bottom, space*51+bottom
	mov     #space*11+bottom-found, found
	cmp     space*12+bottom, space*52+bottom
	mov     #space*12+bottom-found, found
	cmp     space*13+bottom, space*53+bottom
	mov     #space*13+bottom-found, found
	cmp     space*14+bottom, space*54+bottom
	mov     #space*14+bottom-found, found
	cmp     space*15+bottom, space*55+bottom
	mov     #space*15+bottom-found, found
	cmp     space*16+bottom, space*56+bottom
	mov     #space*16+bottom-found, found
	cmp     space*17+bottom, space*57+bottom
	mov     #space*17+bottom-found, found
	cmp     space*18+bottom, space*58+bottom
	mov     #space*18+bottom-found, found
	cmp     space*19+bottom, space*59+bottom
	mov     #space*19+bottom-found, found
	cmp     space*20+bottom, space*60+bottom
	mov     #space*20+bottom-found, found

	jmn     found, found    ; Get out early if found something.

	cmp     space*21+bottom, space*61+bottom
	mov     #space*21+bottom-found, found
	cmp     space*22+bottom, space*62+bottom
	mov     #space*22+bottom-found, found
	cmp     space*23+bottom, space*63+bottom
	mov     #space*23+bottom-found, found
	cmp     space*24+bottom, space*64+bottom
	mov     #space*24+bottom-found, found
	cmp     space*25+bottom, space*65+bottom
	mov     #space*25+bottom-found, found
	cmp     space*26+bottom, space*66+bottom
	mov     #space*26+bottom-found, found
	cmp     space*27+bottom, space*67+bottom
	mov     #space*27+bottom-found, found
	cmp     space*28+bottom, space*68+bottom
	mov     #space*28+bottom-found, found
	cmp     space*29+bottom, space*69+bottom
	mov     #space*29+bottom-found, found
	cmp     space*30+bottom, space*70+bottom
	mov     #space*30+bottom-found, found
	cmp     space*31+bottom, space*71+bottom
	mov     #space*31+bottom-found, found
	cmp     space*32+bottom, space*72+bottom
	mov     #space*32+bottom-found, found
	cmp     space*33+bottom, space*73+bottom
	mov     #space*33+bottom-found, found
	cmp     space*34+bottom, space*74+bottom
	mov     #space*34+bottom-found, found
	cmp     space*35+bottom, space*75+bottom
	mov     #space*35+bottom-found, found
	cmp     space*36+bottom, space*76+bottom
	mov     #space*36+bottom-found, found
	cmp     space*37+bottom, space*77+bottom
	mov     #space*37+bottom-found, found
	cmp     space*38+bottom, space*78+bottom
	mov     #space*38+bottom-found, found
	cmp     space*39+bottom, space*79+bottom
	mov     #space*39+bottom-found, found
	cmp     space*40+bottom, space*80+bottom
	mov     #space*40+bottom-found, found

	jmz     warrior, found  ; Don't Quick-bomb if nothing found.

found   cmp     bottom, 0       ; Find which instruction is not blank.
	jmp     2               ; CMP / JMP 2 is the '88 equivalent of SNE.

	add     #40*space, found ; Goto second location if first is blank.

forward mov     jump, @found    ; Use a SPL/JMP bomb.
	mov     split, <found
	add     #(qbomb+1), found
	jmn     forward, @found ; Keep bombing while B-Field is not 0.


	; Regular warrior starts here.
	; The first instruction should be labeled "warrior".
	; Must include the code for a two-line bomb.
	; (Or, of course, you are welcome to use a different bomb,
	;  such as a single DAT statement.)

warrior jmp     0, <-100        ; Replace this with your own code.

split   spl     0
jump    jmp     -1

bottom  end     scan


;redcode-94
;name Quick-Scan '94 Prototype
;author Brant D. Thomsen
;strategy Add this to the front of your warrior,
;strategy  and see if it improves your score.

space   equ     (CORESIZE/81)   ; Step when scanning for code.
qbomb   equ     6               ; Step when bombing whatever we found.

scan    sne.X   space*1+bottom, space*3+bottom
	seq.X   space*2+bottom, space*4+bottom
	mov     #space*1+bottom-found, found
	sne.X   space*5+bottom, space*7+bottom
	seq.X   space*6+bottom, space*8+bottom
	mov     #space*5+bottom-found, found
	sne.X   space*9+bottom, space*11+bottom
	seq.X   space*10+bottom, space*12+bottom
	mov     #space*9+bottom-found, found
	sne.X   space*13+bottom, space*15+bottom
	seq.X   space*14+bottom, space*16+bottom
	mov     #space*13+bottom-found, found
	sne.X   space*17+bottom, space*19+bottom
	seq.X   space*18+bottom, space*20+bottom
	mov     #space*17+bottom-found, found
	sne.X   space*21+bottom, space*23+bottom
	seq.X   space*22+bottom, space*24+bottom
	mov     #space*21+bottom-found, found
	sne.X   space*25+bottom, space*27+bottom
	seq.X   space*26+bottom, space*28+bottom
	mov     #space*25+bottom-found, found
	sne.X   space*29+bottom, space*31+bottom
	seq.X   space*30+bottom, space*32+bottom
	mov     #space*29+bottom-found, found
	sne.X   space*33+bottom, space*35+bottom
	seq.X   space*34+bottom, space*36+bottom
	mov     #space*33+bottom-found, found
	sne.X   space*37+bottom, space*39+bottom
	seq.X   space*38+bottom, space*40+bottom
	mov     #space*37+bottom-found, found

	jmn.B   found, found    ; Get out early if found something.

	sne.X   space*41+bottom, space*43+bottom
	seq.X   space*42+bottom, space*44+bottom
	mov     #space*41+bottom-found, found
	sne.X   space*45+bottom, space*47+bottom
	seq.X   space*46+bottom, space*48+bottom
	mov     #space*45+bottom-found, found
	sne.X   space*49+bottom, space*51+bottom
	seq.X   space*50+bottom, space*52+bottom
	mov     #space*49+bottom-found, found
	sne.X   space*53+bottom, space*55+bottom
	seq.X   space*54+bottom, space*56+bottom
	mov     #space*53+bottom-found, found
	sne.X   space*57+bottom, space*59+bottom
	seq.X   space*58+bottom, space*60+bottom
	mov     #space*57+bottom-found, found
	sne.X   space*61+bottom, space*63+bottom
	seq.X   space*62+bottom, space*64+bottom
	mov     #space*61+bottom-found, found
	sne.X   space*65+bottom, space*67+bottom
	seq.X   space*66+bottom, space*68+bottom
	mov     #space*65+bottom-found, found
	sne.X   space*69+bottom, space*71+bottom
	seq.X   space*70+bottom, space*72+bottom
	mov     #space*69+bottom-found, found
	sne.X   space*73+bottom, space*75+bottom
	seq.X   space*74+bottom, space*76+bottom
	mov     #space*73+bottom-found, found
	sne.X   space*77+bottom, space*79+bottom
	seq.X   space*78+bottom, space*80+bottom
	mov     #space*77+bottom-found, found

	jmn.B   found, found    ; Quick-bomb if found something.
	jmp     warrior         ; Execute regular code, because nothing found.

	add     #space, found
found   jmz.F   -1, 0           ; Goto the location where we found something.

	mov.B   found, backwd   ; Save this value for use in backward bomb.

forward mov.I   split, >found
	mov.I   jump, @found
	add     #(qbomb-1), found
	jmn.F   forward, @found

	sub     #(2*qbomb), backwd      ; Don't re-bomb over forward-scan.

backwd  mov.I   jump, 0
	mov.I   split, <backwd
	sub     #(qbomb-1), backwd
	jmn.F   backwd, @backwd


	; Regular warrior starts here.
	; The first instruction should be labeled "warrior".
	; Must include the code for a two-line bomb.
	; (Or, of course, you are welcome to use a different bomb,
	;  such as a single DAT statement.)

warrior jmp     #0, <-100       ; Replace this with your own code.

split   spl     #0
jump    jmp     -1

bottom  end     scan

