I'm obsessed with using generative AI to write computer programs. I feel like I've unlocked a superpower. I tell the AI what I want, and it generates the code for me. Then I run it, and if there are any problems, I give it feedback (e.g., "make the page device and width responsive," "put the controls on the side"). After going back and forth with it a bunch of times, I’ll end up with something surprisingly good.
This week, I asked AI to make a "Rule 30" cellular automaton, which Mathematica creator Stephen Wolfram writes about in his 1280-page book, A New Kind of Science (2002). Wolfram posits that much of the complexity we see in the world, like zebra stripes, the shape of snowflakes, neural networks, swarm behavior, and stock market fluctuations are the result of simple rules being repeated over and over.
Here’s the Rule 30 generator that I made with the help of AI.
If you don't know what a cellular automaton is, imagine a group of clams sitting in a circle on the beach. Every few seconds, each clam decides whether to open or close by checking three things: the state of its own shell, its neighbor's shell to the left, and its neighbor's shell to the right. It's like a neighborhood where everyone changes their behavior based on what they and their immediate neighbors are doing.