C++ version of my gameoflife