Take the 2-minute tour ×
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.

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|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
add comment

1 Answer 1

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|improve this answer
add comment

Your Answer

 
discard

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.