A simulation of https://en.wikipedia.org/wiki/Langton%27s_ant written in C using Raylib as the simulator and nuklear as the GUI
A simulation of https://en.wikipedia.org/wiki/Langton%27s_ant written in C using Raylib as the simulator and nuklear as the GUI
Added some QOL features, as well as a makefile for easy building.
For those who don’t know, Langton’s ant is a turing machine ( a popular example of this is Conway’s Game of Life). Initially it only uses 2 rules, but i have expanded it to have more rules, ants and even different options for how the ant moves!
This was all written in C using the Raylib and Nuklear libraries
Added a makefile for quicker building
Tried to add an icon, but it kept on failing
Log in to leave a comment
Mainly bugfixes, but I also added some features
Fixed an issue where the symmetry preset wouldnt work if you used the random preset before
Added tooltips for rules in hexagon mode
Added the ability to go back to the menu
Added a move counter and a popup that appears when all ants die
Log in to leave a comment
I made a simulation of a turing machine made by Chris Langton in 1986, as well as his ants. However I decided to make it fully flegded out with custom rules, more ants and colours, as well as a hexagonal grid, which was most certainly the hardest part!
This was super enjoyable to make and it made me learn quite a bit!
Who knew that the camera wouldve been fixed with one line of code?
Anyways some minor bug fixes as well, so now you can zoom in,out and drag your sim around (soon gonna make a release once all the bugs have been exterminated)
Cool simulation included btw. Rules are L1L2NUL2L1R2
Log in to leave a comment
Hexagons are finished!!! This was a huge pain, but at the very least it works and it looks pretty
Log in to leave a comment
Added camera control + fixed a few bugs.
Now you can zoom into ants and back out.
Also spent like 2 hours trying to make a hexagonal grid until i realised how much of a pain it was and kinda gave up, though might get back to it at some point it is fully fleshed out
Also figured out how to speed it up a TON. This was done in less than a second which is really cool
Log in to leave a comment
Added tooltips which took a lot longer than i expected, but it works!
Sadly couldnt figure out how to hide the mouse without it flickering so i compensated by just putting 2 spaces in front of the actual text
Log in to leave a comment
Made a few presets for some rules.
Added default preset, for the original simulation, which always gives the same results no matter what diraction
Added symmetry preset, that shows a symmetrical image that also loops infinitely
Added random preset, which chooses a random amount of ants, and a random amount of colours, all with random rules.
I neglected showing the seed and really regret it, as it just made this beautiful pattern that i will never see again, but it’s alright :’)
Log in to leave a comment
Fixed some issues in the website, and then into more, and before i knew it, i used 90% of my credits :(
The c version is fixed though so at the very least something good happened, though the website will not be updated until the project is like 90% done (or once february 9 hits and my credits refresh!)
Anyways here’s a cool symmetrical pattern the ants made
Log in to leave a comment
Made it a website! Its not perfect as i just used emsdk and it looks a bit odd but i will get to that in the future, just happy it works in the first place!!
Try it out here https://app.netlify.com/projects/langtons-ant-sim/overview
Optimised the control panel a little bit by reducing the overhead of converting from string to integer, made the ants and colours have random values so there wouldnt be much need to edit too much if one just wants to play around with it
Log in to leave a comment
Finally made it display colours right! Also took advantage of nk_propertyi to add little arrows and remove the overhead of converting from string to integer. Win win!
Log in to leave a comment
Fixed up the random colours being messed up!
Can’t explain why and how to fix it, but hey it works :)
Time to add random direction
Log in to leave a comment
Used nuklear to make a nice control panel. Simulation works like a charm, though there ar still some bugs with the previewed colours and some other things that can be added eg pausing,continuing and speeding up the simulation, though I am very proud of this so far!
Log in to leave a comment