#
# Core Wars program
#
# Hacked to Crap By: Abram Hindle March 1999
# Idea From: Daniel Karlsson's Suicidal QuinTet

# Walter Hofmann, May 1999
#

	title "SpannerFork"
        author "Abram Hindle <abez@home.com>"
FSTART:	move 4,FCOUNT
FORKS:	move &FSTART,A #A POINTS TO START
	move 19,B # this is how many lines of code to copy from cool?
	info 2,C #random 
	move C,E #move random into E C==E
COPY:	movei A, C	#MOVE A INTO C. So the starting command of start
	loop B,COPY	#while b is  > 0 goto copy b is 3 
	fork [E]	
	loop FCOUNT,FORKS
	#jump COOL 
COPYRND: move 4,B
	 info 2,C
	 move &RNDCOOL,A
	 move C,E
	 jump COPY
RNDCOOL: info 2,A
	 info 2,B
RNDLOOP: movei B,A
	 jump RNDLOOP
#COOL:   info 2,A	#A Rand will be the byte after COOL
#	move &FSTART,E
#	move A,C
#	move 29,B
#	add 15,A
#COOL2:	movei E,A
#	loop B,COOL2
#	fork [COPYRND]
#	fork [C]
#	jump COOL
	
A:	data 0
B:	data 0
C:	data 0
E:	data 0
FCOUNT: data 0	
