Game of life in C++ (homework)