Tag: life

A free eBook about the Game of Life

A free eBook about the Game of Life

Front cover of Conway's Game of Life eBook.Remember the cellular automation Life? I covered it in previous blog entries John Conway’s Game of Life and also Portable Life in C. Well, Associate Professor Nathaniel Johnston (in the Department of Mathematics and Computer Science at Mount Allison University in New Brunswick, Canada) and Dave Greene wrote a book/eBook about Life. It’s N. Johnston and D. Greene. Conway’s Game of Life: Mathematics and Construction.

The 474 page eBook is free on this page or you can buy the coloured hardback book. On Amazon that’s a modest £59.99! The PDF is 93 MB in size.

Ever since Life was publicized in Scientific American in the 1970s, it’s held a fascination for many including myself. I wrote a program (in Basic) 45 years ago to run it, but it was quite slow. One of the fastest I ever saw was written in 6502 assembly language running on an Acorn Atom. A very comprehensive and fast open source Life is Golly, written in C++ and is scriptable in Python or Lua.

But back to the book. If you are a real life afficionado and know the difference between a Glider and an Oscillator then this book/eBook is definitely for you. It’s a detailed look at Life from an academic point of view.

 

 

 

Portable Life in C

Portable Life in C

apelifeI’ve mentioned Life before, this is the cellular automata as discovered by John Horton Conway. It’s perhaps less of a game and more of a recreation for anyone fascinated by programming. It’s hard to add up how many man-hours have been spent on it.

Developer Justine Tunney (aka Jart on Github) has developed a portable Life called Apelife. Portable as in it can run on Windows (graphically) and Linux (Text User Interface). The application is a modest 112 KB in size and is one of the fastest I’ve seen. When you have a large area and gliders whizz across it, you know its fast.

She is also the author of Cosmopolitan C which Apelife uses.  It lets gcc outputs portable binaries that will run on every Linux distro in addition to Mac OS X, Windows NT, FreeBSD, OpenBSD, and NetBSD. It’s rather ingenious.

 

 

John Conways Game of Life

John Conways Game of Life

Golly - Life simulatorAn English mathematician John Conway (who died not that long ago) came up with a very simple cellular automaton that he called Life. This was back in the 1970s and I remember finding his original article in Scientific American while at University.

We had no internet then and I whiled away 10 or so hours trying to make my version of Life run faster. Given that this was 1978 and it was written in BASIC, it’s not surprising that it only did a couple of generations per second on a mainframe. They didn’t give us much CPU time and it was an ICL 1900. My iPhone is probably more powerful!

The rules are simple enough to implement but it’s unlikely you’ll outperform Golly which is what the image shows. That’s written in C++ and has been under near continuous development for the last 15 years.

But part of the fun is writing your own life simulator and watching the patterns explode. I’d call it the minecraft of its day given the amount of computing time spent on this since the 1970s. There are some amazing creations all following these three simple rules.

  • Any live cell with two or three live neighbours survives.
  • Any dead cell with three live neighbours becomes a live cell.
  • All other live cells die in the next generation. Similarly, all other dead cells stay dead.

The grid is just a simple bit field. Each cell is either on or off and the rules determine if new cells are created or if patterns die out.

There are innumerable ones on the web. Here for example is a C/SDL version. Note, it uses SDL1. When I get the time, I’ll build and run it. Comments are in French!