Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|cite|improve this question
This is better asked at Stack Overflow – Peter Phipps Aug 7 '12 at 15:01
@PeterPhipps Conway's Game of Life is a mathematical algorithm and hence the question is posted here – Sandbox Aug 7 '12 at 15:04
@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. – Steven Stadnicki Aug 7 '12 at 15:14
(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.) – Steven Stadnicki Aug 7 '12 at 15:15
up vote 3 down vote accepted

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.

share|cite|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.