%
%	vondriver.t
%
%	Driver to create von Koch fractals
%
include "fractaltypes.t"
include "vonkoch.t"
include "init.t"

var newfractal, oldfractal: fractal
var ans: string
var n, nnew: int

setscreen("nocursor")
setscreen("graphics:800;800")

line(oldfractal,n)				% init oldfractal to a line
triangle(oldfractal,n)			% init oldfractal to a triangle
square(oldfractal,n)			% init oldfractal to a square

% PutFractal(oldfractal,n)

put "Plotting von Koch curve"

loop
	put "Hit return to continue or 'quit' to stop " ..
	get ans: *
	exit when ans = "quit"
	Replace(oldfractal, n, newfractal, nnew, RepVonKoch)
	DrawFractal(newfractal, nnew)
	oldfractal := newfractal
	n := nnew
end loop
