Month: February 2023

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.

 

 

 

Is C a portable language?

Is C a portable language?

brown and black suitcase with red and yellow plastic toyI occasionally write answers on Quora.com and many recurring questions are about assembly language. Now I used to write games in 6502 and Z80 assembly language when the only alternative was Basic. But assembly language is very tedious to write, painstaking and it’s slow to write programs in assembly language. Most of your code is moving values between memory and registers or vice versa.

Anything major you write will not easily port onto a different CPU or Operating System. A Mac uses a different CPU to most Windows PCs and a Raspberry Pi uses a similar CPU design to a Mac (M1 or M2) but there are still differences in calling OS routines on Raspberry Pi OS (based on Debian) and Mac OS.

Higher level languages are generally portable. I’ve written C# code that runs on Linux and my game which was 2,200 lines of C needed about an hours work to run on Ubuntu Linux and Raspberry Pi.

But if you have a large complex C application, it may have issues when porting it.  A developer Rex Jaeschke wrote a book on portability and published it in 1989. He’s recently updated it and it’s available on Wikibooks.  It’s called Portability and the C language and is several hundred pages long. If you ever want to port C, it is very worthwhile reading. I’ve added a permanent link to the Link to C utilities page.