24 comments

[ 682 ms ] story [ 118 ms ] thread
Good work! Highly recommend adding a gif of a few seconds of your game in your README so people can enjoy this without having to build and run it.
Do you have any recommendations on how to do that? I tried to make a gif for my project a month or two ago by capturing my terminal output in ttyrec, then using ttygif to turn it into an animated image. However, ttygif ultimately passes things off to ImageMagick convert, which would run until my computer ran out of memory and then crash.

I tried using ffmpeg to create a video instead of a gif, but I struggled getting it to correctly reproduce my colours and I couldn't figure out how to handle the occasional variation in time between frames in my capture.

For terminal stuff, you can't beat the ease of use of asciinema.
That's what I'm currently using, but I think a gif/video would work better for my program. My recording is supposed to run at ~10fps and the asciinema web player can't keep up. I get less than 1fps on the first play-through, and it dips as low as 2fps on subsequent plays.
Licecap / Zappy

Or Loom -> MP4 -> ezgif

There's a lack of good GIF making tools

I use recordMyDesktop. If what I need is a gif, then I convert it with ffmpeg.
Following up on this, I was inspired to try again. I decided to give APNG tools a shot, as it seems that APNG support is pretty good these days[1]. It was straightforward to build apngasm[2] and ttygif[3] from their GitHub sources on Ubuntu. I modified ttygif to generate a command for apngasm rather than for convert, and found that it could easily handle my data.

Unfortunately, apngasm does not seem to handle gamma correctly, resulting in more muted colours in the output APNG than in the input PNGs. If I can find the time, I'll fix that up and open-source the various tweaks I made. My current results are[4][5], though I may update those images as I improve them.

On a related note, it seems that it's no longer possible to remove the window decorations from gnome-terminal on Ubuntu 19.10, which is unfortunate for ttygif captures. I switched to my Ubuntu 18.04 machine to do a capture without the window border.

[1]: https://caniuse.com/#feat=apng [2]: https://github.com/apngasm/apngasm [3]: https://github.com/icholy/ttygif [4]: https://slerp.xyz/demos/ascii-euler/block.png [5]: https://slerp.xyz/demos/ascii-euler/waterfall.png

(comment deleted)
One final update, I think part of the colour problem was actually because the Ubuntu terminal is slightly transparent by default, and different alpha blending resulted in slightly different colours.
I went ahead and added one, thank you for the suggestion!
Why are there function definitions in header files? Really the only reason to do this is if you are distributing a "header-only" library.
It honestly bothered me at first too, but now that your comment isn't [dead] I can finally reply and say it was because I was too lazy and didn't want to write extra code / bash script for it. It works perfectly fine with just a header file, and isn't dissimilar to something an early year University student would write, which is definitely the caliber of this project.
I made one of these recently too. Mine allows you to simulate many different kinds of 2D cellular automata, but Conway's Game of Life is the default.

[link redacted]

I like writing life in new programming languages as a sort of non-trivial "Hello World". It was the first program I wrote when I was first learned CUDA/C++ back in 2008 and was a great teaching example.

I remember it being the first thing I wrote in Turbo Pascal for the IBM PC back in 1984 or so.

Seems we've all been busy. I made a simple browser version. https://animate-object.github.io/life.

Life was one of my first introductions to programming in school. Mr. Conway also a strong impression on me through his interviews with Numberphile, which I'd recommend, not so much for their mathematical content, but for the very human portrait of a genius in his later years.

Mine was on a PDP-11 in assembly language, displayed on an oscilloscope screen. Back in college, in a device-control lab class. A great program to form the core of any kind of project - assembler, web, device, whatever! I recommend it.
I learned, from Hackers by Steven Levy, of Bill Gosper's work on Life at the MIT AI Lab. Apparently they had two versions of Life running on a PDP-10 there, under the ITS operating system. Gosper wrote his in TECO (a programming language used to edit text), and another in MIDAS, written by Mike Speciner. But ITS no longer ran, and the Life programs appear to have been been lost.

Some time afterwards, there was a project to resurrect ITS, which I got involved in. After it was up and running, initially on the SIMH simulator, and later more stably on Ken Harrenstien's klh10 emulator, I wrote a new version of Life for it in MIDAS (PDP-10) assembly language, which is now located at http://www.fmjlang.co.uk/its/life.txt

This drew the attention of Dan Weinreb, who provided some information on the original AI Lab version: https://web.archive.org/web/20050209065438/http://lispmeiste...

That was one of the first programs I wrote when I had my first computer, back in 1985. Before that I was already fascinated by Game of Life and there was no other way than to write out every generation by hand ..
Here is our Twitch Plays implementation: https://www.twitch.tv/bzh314

It supports RLEs [1] so you can quickly create some known shapes or test your own.

Crash course on RLEs:

b=dead, o=alive, $=new line

This is the RLE of xkcd's tribute to John Conway [2]:

2b3o$2bobo$2bobo$3bo$ob3o$bobobo$3bo2bo$2bobo$2bobo!

You can discover plenty of patterns with their RLEs on the Life Wiki [3]

Twitch Plays Conway's Game Of Life has a database of hundreds of patterns.

To learn patterns here's a 40-minute video you can quickly go through: https://www.youtube.com/watch?v=u4XgALyX6w8

For instance you can make a Sir Robin [4] at the origin this way:

!SirRobin 0.0

or the xkcd pattern:

!xkcd 0.0

We also added our own twist, with color rules that lead to the Epic Toy Store Pixel Art [5] and Epic Masterpiece Pixel Art Decoration [6]

---

[1] http://www.conwaylife.com/wiki/Run_Length_Encoded

[2] https://xkcd.com/2293/

[3] https://www.conwaylife.com/wiki/Main_Page

[4] https://www.conwaylife.com/wiki/Sir_Robin

[5] https://www.youtube.com/watch?v=JH5RzNnamW0

[6] https://www.youtube.com/watch?v=RKxKac5YHag