Game of Life functions

All,

The assignment is just to create a 42x42 grid (so that we have a 1 space buffer, working with spaces 1-41.) We will manually create the first grid (within our code, not user inputted), then play and print forty iterations of the grids. My big question is that, to me, it seems as if all my functions should be private? Theoretically, a user shouldn't be accessing them. If I do that, I would then need to make the print function a friend of the Life class so that it can access the private grids, right? Or can I just declare the grids public and not have to worry about it? Also, if you see any other functions you think I should write that would make this simpler, please let me know. (No code, just a brief description of it, please.)

I was just wondering if you could help me figure out what other kind of functions I'd need in order to complete this assignment? So far I have:

void Life (constructor; initializes two 2d arrays)
bool isAlive (checks if cell is alive, returns true)
int numNeigh (checks number of neighbors)
bool toggle (determines if cell should die/awaken)
void print (prints 40 iterations)

Sorry about not having any code, I'm still kind of planning out my method of attack for this project.

I appreciate any input you can offer. Thanks!
Last edited on
Topic archived. No new replies allowed.