Drawing a path is done with the “pen” block. To explore where the path can
go, the algorithm can “look ahead”. We do that by memorizing the current x and y position,
then lifting the “pen”, and then moving forward. If it senses the color it is looking for,
it knows to go no further. If not, it goes back to the old x and y position, lowers the pen,
and moves to the new position.
Notice that the hand gets “stuck.” Help the hand! For example you can track the number of
times it gets stuck and use a random place to restart.
Shipibo fractal curve
Not all complexity is due to random action. Fractals are one way to create
deterministic complexity. Fractal curves can be created by recursive line replacement, in
which each line that composes a figure is replaced by a smaller version of the whole. Try
experimenting with the example here:
Percolation describes the flow of water in soil, fire in a forest, etc. It
is a “parallel search” because the water attempts to find many different paths at the same
time. One way to simulate that is a “back track” that recalls an earlier point and begins
branching from there.