by JHonaker · 9y ago · 0 comments
It was my first non-trivial project in Nim. I had a lot of fun. It uses SDL 2 as the graphics engine. Let me know if you have any little suggestions for it, or any questions about the development.
Haha, nice catch because I just did that on the other thread ;) https://news.ycombinator.com/item?id=14387684 boring implementation of the classic game of life. I don't know if it's a pure coïncidence or not but I'll have a look at your repo, nice work !
Your GoL implementation is so pretty though. I really need to work on my design skills.
A while back I implemented it in typescript and ran the computer startup file through it for the web. It is such a fun piece of logic to squeeze every nanosecond of performance out of.
https://github.com/dested/WireWorld/blob/master/WireWorldTyp...
This is the file for the computer, shoot me an email if you ever get around to implementing it. I'd love to see the result and talk about optimizing! dested at gmail
For a more flushed out example there's: https://hookrace.net/blog/writing-a-2d-platform-game-in-nim-...
I did use a tiny bit of code from the tutorial on 2D platformers linked by someone else.
I'm surprised it was that brief actually. I didn't even try for brevity. And I'm sure if I had a better handle on some of the other features like macros and templates it could have been much more elegant in the display/SDL code.
The actual implementation of the automaton is only about 70 lines of code if I remember correctly.