I was inspired by Erik Nauman's Generative Art and the LogoTurtle post and decided to program some fractal art for the LogoTurtle to draw.
First, I reached out to Erik for a little assistance adapting my TurtleArt Dragon Curve procedure to LogoTurtle. He and Brian helped me by building a little random number generator that helps determine whether the LogoTurtle turns right or left 90 degrees.
This procedure calls for repeating many times or even looping infinitely. The only limitation is the amount of ink in the pen and the size of your canvas!to dragon.curverepeat 100 [fd 50ifelse (random 0 10) < 5[rt 90][lt 90]]
The next procedure was adapted from Michael Friendly's Advanced Logo. I have been wanting to understand and create a tree pattern like this for some time: this exercise put me on that path.
First, I ran it small with the following procedure:to tree2 :len :depth :angif :depth = 0 [stop]lt :ang fd :lentree2 :len (:depth - 1) :angbk :len rt 2 * :angfd :lentree2 :len (:depth - 1) :angbk :len lt :angend
repeat 3 [tree2 20 5 12 lt 60]
The design is surprisingly organic and beautiful. The trunk is not quite right, though.
The next time I ran it I sized it up considerably:
to startuppdwait 1000rt 60repeat 3 [tree2 100 5 12 lt 60]rt 120bk 100pualloffend
It was also beautiful.
LogoTurtle, like elsewhere, proves to be a fun and beautiful place to examine fractals and mathematics.