C++ : game of life? (URGENT)

i really need your help and really fast.




 
  
Last edited on
A minor point, at lines 44 and 46 in function is_live() the = operator is used instead of ==. Also the function should return a default value if nether of these conditions are true.

However, there seem to be deeper issues at the design level of the program.

In function _neighbors() at line 51 a new array is created, char c[_rows][_columns] = {0}; in the local scope. This cannot work in this context as the returned value of count will always be the same. I think there should be an array of cells rather than an array of characters, and it should be created at a higher level, presumably as part of the class Life or one of its derived classes.

Shouldn't classes ConwayLife and FredkinLife inherit from class Life? Also those two classes surely should make use of the ConwayCell and FredkinCell classes.
Topic archived. No new replies allowed.