When trying to program Conway's Game of Life, is it okay to have a grid with unequal number of rows(>=2) and column (>=2) OR Is it mandatory to have equal number of rows and columns?

  • $\begingroup$ This is better asked at Stack Overflow $\endgroup$ Commented Aug 7, 2012 at 15:01
  • $\begingroup$ @PeterPhipps Conway's Game of Life is a mathematical algorithm and hence the question is posted here $\endgroup$
    – Sandbox
    Commented Aug 7, 2012 at 15:04
  • $\begingroup$ @Sandbox Conway's Game of Life is a mathematical abstraction - the number of rows and columns in the grid is an implementational detail. (There are interesting questions about the ultimate outcomes of Life on finite grids, but that's not what this question is asking about). I concur that this Q would go better elsewhere, since it's interested in the implementation details. $\endgroup$ Commented Aug 7, 2012 at 15:14
  • $\begingroup$ (That said, the answer is 'yes, there's no reason they have to be equal'. Also, canonically things tend to be more interesting if you 'wrap' your grid and have periodic boundary conditions rather than an 'infinitely absorbing' sea of 0s surrounding it.) $\endgroup$ Commented Aug 7, 2012 at 15:15

1 Answer 1


There are many different implementations of Conway's Game of Life that depend on the structure of the grid. Quadtrees (used in Hashlife) are great for infinite grids. However, the "rules" of the Game of Life aren't specific as to the dimensions (if they exist) of the grid - it depends on what precisely you are programming.

The classic Game of Life, however, uses an infinite grid.

I agree that this question would get more and better feedback at Stack Overflow.


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .