Carpet

Download it here. You'll need Processing installed.

Carpet is a very simple program for exploring variations of the Sierpenski Carpet. You may know of the Sierpenski Carpet as the 2D version of the Menger sponge. Here is a gif of it's construction from Wikipedia:

You start off with a square. Then, you divide that square into ninths, and color each according to the color of the big square. Then, you repeat for each of the small squares, ad infinitum. For Sierpenski's Carpet, the rules are:

###    ###
### -> #.#
###    ###
...    ...
... -> ...
...    ...

Now, the Sierpenski's Carpet is cool and all, but why stop with just that one rule? We can do SO much more. Enter Carpet. Carpet allows you to explore every possible variation of fractal carpets interactively. When the user starts the program, they are greeted by the familiar Sierpenski's Carpet (Click on the image for a higher resolution image): Left-clicking on a ninth of the window toggles the “on” rule for that ninth. For example, if the user clicked on the upper-left ninth of the screen, the transition rule would become:

###    .##
### -> #.#
###    ###
...    ...
... -> ...
...    ...

And the window would look like: Similarly, right-clicking toggles the “off” rule:

###    ###
### -> #.#
###    ###
...    #..
... -> ...
...    ...

Pretty cool, eh? Here's some images that I got from clicking around a bit: