Conway’s game of life


Author Message
Turbo46

Guru

Joined: 24/12/2017
Location: Australia
Posts: 1619
Posted: 01:19am 28 Apr 2020      

  Quote  Integer calculations being slower seems highly unlikely

That was my expectation but I seem to recall being corrected on that myself (by CaptainBoing?). I'll do some tests.

  Quote  Now when considering adjacencies A is considered to be next to 8 potentially "live "cells T, P, Q, E, B, J, F and G instead of 5 of the cells it is next to always being "dead"

I get it. A 'glider' going off the right of the display would then enter from the right?
  Quote  I haven't had opportunity to measure it myself, but isn't that perceptibly slower than printing as you go along?

Yes, There is a pause while spawning the next generation but then printing the next generation is quicker. I think it looks better.
  Quote  Aside: it also uses more memory but that isn't an issue for such a small program and in any case you are already using 4 bytes to store each cell where you only need 1 bit.

Yes, unfortunately. Any packing and unpacking the data would slow it down though.

Bill
Keep safe. Live long and prosper.