optimized game of life shell printing