A curiosity journal of math, physics, programming, astronomy, and more.

Lindenmeyer fractals by LLMs

Three years ago I wrote a series on Lindenmeyer fractals, including randomly generating them. While there were some interesting random results, they were qualitatively different from the highly regular ones designed by humans. Let's see if LLMs can do better.

Claude reproduced several known L-systems, spitting out a Koch snowflake, two Sierpiński triangles, and a dragon curve with 88-degree turns instead of 90-degree turns. It included several definitions that popped and pushed state, but I haven't added support for that to my L-system code, so I didn't draw any of those. The only remaining system was this wandering line:

A wandering line produced by an L-system.

ChatGPT produced some wandering lines like the one above, a sloped line made of squares, and this looping design:

A looping design produced by an L-system.

It did, however, produce one interesting one, which it called a "hexagonal weave":

(def hex-weave
  '{:axiom [A]
    :rules {A [F + B - F - B + F]
            B [F - A + F + A - F]}
    :moves {+ [:turn 60]
            - [:turn -60]
            F [:forward 1]}})
A "hexagonal weave" L-system.
The "hexagonal weave" L-system at several levels of recursion.

I don't know if it derived the definition from some known system. If it looks familiar to you, let me know.

My prompt for ChatGPT and Claude was quite rudimentary, so if you have recommendations for how I might elicit more interesting designs, please email me.