Langton's Ant in 512b.

Showcase your libraries, tools and other projects that help your fellow love users.
Post Reply
Palmar
Prole
Posts: 23
Joined: Thu Dec 13, 2012 3:54 pm

Langton's Ant in 512b.

Post 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?
Attachments
main.love
(455 Bytes) Downloaded 197 times
Palmar
Prole
Posts: 23
Joined: Thu Dec 13, 2012 3:54 pm

Re: Langton's Ant in 512b.

Post by Palmar »

Same, but colorful, with 19 more ants and in 1Kb. Controls: Right - 20x speed, Left - normal speed.
Image
Attachments
main.love
(643 Bytes) Downloaded 137 times
User avatar
veethree
Inner party member
Posts: 876
Joined: Sat Dec 10, 2011 7:18 pm

Re: Langton's Ant in 512b.

Post 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 148 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 151 times
Palmar
Prole
Posts: 23
Joined: Thu Dec 13, 2012 3:54 pm

Re: Langton's Ant in 512b.

Post by Palmar »

Thanks for posting your implementation, veethree. Pretty nice.
UPD: Demo is updated for LOVE 0.9. Developers, thanks for speed improvement.
Attachments
main.love
(648 Bytes) Downloaded 130 times
Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot] and 2 guests