Page 1 of 1

Langton's Ant in 512b.

Posted: Sat Dec 28, 2013 9:05 pm
by Palmar
My small implementation of a very simple two-dimensional Turing machine, name Langton's Ant. Done in 512b, one hour of life wasted. Maybe there are people that have own interesting programs in 128b/512b/1kb/8kb?

Re: Langton's Ant in 512b.

Posted: Mon Dec 30, 2013 9:13 pm
by Palmar
Same, but colorful, with 19 more ants and in 1Kb. Controls: Right - 20x speed, Left - normal speed.
Image

Re: Langton's Ant in 512b.

Posted: Tue Dec 31, 2013 12:52 am
by veethree
I messed around with something like this a few days ago actually. My goal wasn't a low file size though. And it's not necessarily langon's ant, It was initially but i expanded on it.

My implementation is something like what's described in the "Extension to multiple colors" section on the wikipedia page, Except you can have cells that don't change the ants direction.

You can add as many ants and cell types as you want too. This stuff is pretty fun to mess around with. If an ant hits the edge the screen weird things happen though, Don't feel like fixing that. lol

Requires 0.9.0 (Is it safe to stop mentioning that yet?)

It's set up as a standard langtons ant at the moment, There's a table called pat near the top of map.lua that you can add cell types or whatever to to modify it ({"r", "l", "l", "r"} is pretty neat). Space toggles the simulation
not necessarily langtons ant.love
(2.6 KiB) Downloaded 162 times
EDIT: So i've expanded this a bit further, Added another cell type thing that sends the ant in a random direction. And also made it be able to run multiple simulations simultaneously to see how different the patterns it creates are. (i'm bored)
this runs 6 simulations with the pattern left, right, random. This can easily be customized with the variables in love.load.
theseantsareprettyneat.love
(2.87 KiB) Downloaded 154 times

Re: Langton's Ant in 512b.

Posted: Tue Dec 31, 2013 11:20 am
by Palmar
Thanks for posting your implementation, veethree. Pretty nice.
UPD: Demo is updated for LOVE 0.9. Developers, thanks for speed improvement.