To homepage
So, this is my first real project uploaded here, so there we go!
A while ago, i watched Daniel's video on "elementary celular automatons" (here), and i wanted to do such thing myself. At the time, i used a raspberry pi 4b as my main computer and i started writing it in python. One of python inherent problems is, that it is incredibly slow. (OK, not that slow, but you get the point) And so i thought i'd do a rewrite in C, because it was one of the few other languees that i was at least somewhat familiar with at the time, and so i did!
However, it now turns out, i cannot find it anywhere, and it looks like the file is corrupted.
So i figured, LET'S DO ANOTHER REWRITE, this time the proper way! Sort of. So i did!
Now, beware, it doesn't have properly sanitized input, but what's the chance of it being used by anyone, let alone in a more serious environment.
I first quiclky threw together something that sort of worked but it was really buggy and soon i decided to ditch the memcpy, because i didn't have any idea how to use it.
Here's how that went:
And this worked well enough! It was working and it was one of the least ugly pieces of code i've written so far.
But the problem i had with it, even though it was plenty fast, was that i felt the copying of the values could be done way more efficiently.
And so i did another rewrite, this time based on the previous code:
These are very easy to compile - cc automaton-v1.c -o automaton
Also very easy to run - just type ./automaton in terminal.
And in case anyone wanted, i also compiled a static binary for i486 linux here and also a binary for (some?) Windows here, though it needs Microsoft Visual Studio C/C++ to run. Or maybe MinGW, because it was compiled with it? Idk.
You can test it and leave me a message in the guestbook i guess.