386193 (5) [Avatar] Offline
I completed the "Get Programming with Go" Chap 20 capstone Game of LIfe in Go with full test coverage:
Nathan Youngman (56) [Avatar] Offline
Hey Doug,

Thanks for posting your solution, and for writing tests too. I like how you put comment headers in the tests to show what the grid looks like.

One suggestion I have is just an optimization to not be allocating things like width, height, and the neighbours array on each iteration -- it's unnecessary work. For this size of grid it hardly matters, it's just a thought.

The solution in the appendix uses package level constants, but you could also make Universe a structure containing width, height, and the array/slice -- that is, if you've already looked at pointers.