# spiralfoo.kbs - 2010-10-01 j.m.reneau
# draw a mandala of geometric shapes
#
# It became increasingly plain to me that the mandala is the centre. It is the exponent of all paths. It is the path to the centre, to individuation.
# - Carl Jung (1875-1961)
# often considered the first modern psychologist - Wikipedia
#
graphsize 500,500
dim shape(1)
scale = graphwidth
while scale > 1
gosub randomshape
gosub randomcolor
x = .5 * graphwidth
y = .5 * graphheight
da =2 * pi / (int(rand * 20) + 2)
for a = 0 to 2 * pi step da
stamp x, y, scale, a, shape
next a
scale = scale * .95
end while
end
randomcolor:
color 256*rand, 256*rand, 256*rand
return
randomshape:
nsides = 3 + int(rand * 10)
redim shape(nsides*2)
shape[0] = 0
shape[1] = 0
for npoint = 2 to nsides*2-1
shape[npoint] = rand
next npoint
return