Context Free Art – Tutorial 6

Today we start to think recursively. The following example uses a simple recursive definition of a SQUARE. In Context Free Art, we may not need to specify a stop condition when each iteration reduces its size, until eventually, the shape is too small to display.

startshape Shape1

rule Shape3 {
	SQUARE {a -0.9}
	Shape3 {s 0.9 r 7}
}

rule Shape2 {
	4 * {x 1} Shape3 {r 45}
}

rule Shape1 {
	4 * {y 1} Shape2 {}
}
Recursive pattern