Skip to content

Ecce Signum

Immanentize the Empathy

  • Home
  • About Me
  • Published Works and Literary Matters
  • Indexes
  • Laboratory
  • Notebooks
  • RSS Feed

Langton’s Ant 3D, Version 2

2008-10-03 John Winkelman

Langton's Ant in 3D

Another Langton’s Ant 3D experiment. Click here to run the experiment.

I finally got the ruleset sorted out, and now I have a simple 3d version of Langton’s Ant up and running. This is how it works:

Remember the behavior of Langton’s Ant:
1. If the ant is on an empty cell, color it in and move according to the next rule in the set.
2. If the ant is on a filled cell, empty the cell and move according to the previous rule in the set.
3. Do not talk about fight club.

The space in which the Ant is moving is a 50x50x50 (125,000) grid of cells.

There are eight rules which the ant follows, which – if none of the cells are colored in yet – the ant will follow in sequence:

1. Z–
2. X++
3. Y++
4. X–
5. Z++
6. X++
7. Y–
8. X–

In non-computerese, when the applet first runs, the ant will travel in, right, down, left, out, right, up, left, and in doing so fill in eight cells which make up a 2x2x2 cube.

2-3
5-4

1-8
6-7

With the next step the ant begins to encounter filled cells, which mean it takes a step back in the ruleset, and perhaps another, and eventually start to travel to new cells.

It is important, in order for the ant to make the desired patterns, that the sequence of movements in the ruleset visit each cell in a cube of cells exactly once, with the next iteration through the ruleset returning the ant to the original cell. Also, no diagonal movement; only cell face to cell face. I am not sure if this can be accomplished with more than a 2x2x2 cube.

In this demo the cells are colored in according to the “depth”, or the Z value of the cell-s position. Cells farther in the “back” are blue, and cells closer to the “front” are red. All layers (Z) are faded back except for the layer in which the Ant is currently moving. This is why there appears to be a “screen” of cells which moves back and forth and changes colors constantly.

Also in this demo, the pattern created appears to trend to the lower right corner of the screen because each of the layers, back to front, has been offset one cell to the right and one cell down, to provide a sort of isometric view of the pattern.

More experiments along these lines to come, after my brain cools down a bit.

Posted in ProgrammingTagged cellular automata, Flash comment on Langton’s Ant 3D, Version 2

Langton’s Ant 3D, Version 1

2008-10-02 John Winkelman

Langton's Ant in 3D space

Click here to see the ant in new amazing 3D action.

My first attempt at moving Langton’s Ant into a 3D grid. The 3D part was easy – just add some Z movement to the existing X and Y pattern.

This is what you are looking at: there are 100 cells in the X (left and right) and Y (up and down) plane, and 25 in the Z (toward and away from the viewer) plane. There is one bitmap for each Z level, making for 25 stacked bitmaps. The bitmap in which the ant is currently moving is set at 100% opacity, with the surrounding bitmaps becoming increasingly opaque until they are almost transparent. When the experiment seems to flicker, it is because the ant is rapidly switching between Z levels. Those long horizontal “roads” the ant makes are probably more like tubes when viewed in 3D space.

Making the ant move in an interesting pattern is a little more difficult. In 2D (X,Y) space, from each point the ant can either turn left or right, and move forward one space, depending on the state of the cell to which the ant moves. That means, using initial conditions, the ant will move in a perfect square: up 1, left 1, down 1, right 1, and end up back at the original square. In order for me to make that work in 3D space, the ant must visit each of eight cells, forming a cube, and return to the original cell without doubling back on itself. The current experiment does not do that, thus the long horizontal runs.

Right now there are 18 rules for the ant’s movements. Each of these rules is iterated through, based on the color of the cell on which the ant lands. Landing on an “off” cell causes the ant to move according to the next rule. Landing on an “on” cell causes the ant to move according to the previous rule. If I implement multiple “on” colors, then I can cut the movement rules down to 6, but I will need to have each rule account for the color of the cell in which the ant currently resides.

Look for more iterations on this problem in days to come.

Posted in ProgrammingTagged cellular automata, Flash comment on Langton’s Ant 3D, Version 1

Lil’ Gamera

2008-09-30 John Winkelman

Baby turtle on Cynthia's Knee

Click the photo to see the rest of the set taken at the Yankee Springs Recreation Area.

Posted in Photography comment on Lil’ Gamera

Langton’s Ant – Hex pattern

2008-09-29 John Winkelman

Langton's Ant - 6

Click here to see it running.

Mostly similar to the previous Langton’s Ant experiment, this one uses a hexagon-ish algorithm instead of a quad. Because I am using square pixels to draw the results, it isn’t precisely a hexagon, but it is close enough to get the point across. Actually, the “ant” view is quite a bit more interesting than the heatmap view.

Click the Flash movie to toggle between the views.

Posted in ProgrammingTagged cellular automata, Flash comment on Langton’s Ant – Hex pattern

Langton’s Ant with Heat Map

2008-09-26 John Winkelman

Langton's Ant Heat Map

Click here to see it in action.

This is an update to the previous Langton’s Ant experiment. For this one I have added a heat map which shows the frequency with which the “ant” visits each cell in this grid. The more visits to a cell, the “hotter” the color. Click the application to toggle between the ant view and the heat map view.

I am really enjoying playing around with this thing. I have “hex” and “oct” variations (the above is a “quad”) waiting in the wings, and am exploring what it will take to make a 3d version, which hopefully I will have done this weekend.

Posted in ProgrammingTagged cellular automata, Flash comment on Langton’s Ant with Heat Map

I Am A 39-Year Old Fanboy

2008-09-25 John Winkelman

Neal Stephenson reading from Anathem

Neal and me

The bald fella with the big facial hair is Neal Stephenson, author of many wonderful books including Cryptonomicon – my freshly-signed copy of which he is holding – and Anathem, which is his latest book. He was at Schuler Books and Music on 28th Street yesterday for a reading and Q-and-A session. He was very personable, if quite tired-out from the book tour, which has taken him all over the country in a fairly short amount of time.

During QA, I asked him what he thought the next Age might be, in the context of the ages he described in his early novel, Interface  (A run-down of those ages is here). He got a funny look on his face and said “You’re asking me to predict the future.” Then he went on to opine that people nowadays seemed to be increasingly afraid of anything of significant complexity, and they were looking for simpler lives. One way they (we) are doing this is to latch onto people with powerful personalities and let them lead the complicated lives while we follow safely in their wakes. This is an observation toward which I will need to direct some significant thought.

After I finish reading Anathem.

Posted in Literary Matters comment on I Am A 39-Year Old Fanboy

Langton’s Ant, Reboot

2008-09-24 John Winkelman

Langton's Ant

Click here to run the ants.

Another Cellular Automaton experiment. The rules for this one work as follows:
0. Place an ant on a grid.
1. check the color of the square the ant is on.
2a. If the square is red, turn it black and turn to the left.
2b. If the square is black, turn it red and turn to the right.
3. Move forward one square and repeat.

No interaction here; it will do the same thing every time you visit.

If you are patient, some interesting things begin to happen around iteration 10,000.

Posted in ProgrammingTagged cellular automata, Flash comment on Langton’s Ant, Reboot

Automata I

2008-09-23 John Winkelman

Cellular Automaton

Click here to run the automata.

Once upon a time I did something like this, maybe back in 2003 or 2004. I recently re-arranged my bookshelves and discovered my copy of A New Kind of Science by Stephen Wolfram. So now I have caught the CA bug.

Click the application to reset it. More interaction will be coming soon.

Posted in ProgrammingTagged cellular automata, Flash comment on Automata I

Only Godzilla Can Save Us Now!

2008-09-22 John Winkelman

Baby Snapping Turtle

Baby Snapping Turtle

Posted in Photography comment on Only Godzilla Can Save Us Now!

Weekly Gyruss Update

2008-09-19 John Winkelman

Gyruss-like Flash game

The weekly Gyruss update. Click here to play around.

Another update – this one focusing more on graphics. I really think the rotating background adds something, but to make it look good I had to mask it to a circle in the center, and that seems to ask for a groovy border of some kind. Yeah, definitely a groovy border.

Posted in ProgrammingTagged Flash, game development comment on Weekly Gyruss Update

Posts navigation

Older posts
Newer posts

Personal website of
John Winkelman

John Winkelman in closeup

Archives

Categories

Posts By Month

August 2025
S M T W T F S
 12
3456789
10111213141516
17181920212223
24252627282930
31  
« Jul    

Links of Note

Reading, Writing
Tor.com
Locus Online
The Believer
File 770
IWSG

Watching, Listening
Writing Excuses Podcast
Our Opinions Are Correct
The Naropa Poetics Audio Archive

News, Politics, Economics
Naked Capitalism
Crooked Timber

Meta

  • Log in
  • Entries feed
  • Comments feed
  • WordPress.org

© 2025 Ecce Signum

Proudly powered by WordPress | Theme: x-blog by wpthemespace.com