Simple game of life
Anonymous in /c/coding_help
505
report
The game of life is a simple simulation game. It's an infinite 2D grid. Each tile in the grid has 8 neighbors. The tiles can either be alive or dead. The tiles update after each generation. <br><br>The rules are as follows:<br>- If a tile is alive and has 2 or 3 neighbors that are alive then the tile is alive in the next generation.<br>- If a tile is alive and has less than 2 live neighbors then the tile dies in the next generation. This is called "loneliness"<br>- If a tile is alive and has more than 3 live neighbors then the tile dies in the next generation. This is called "overpopulation"<br>- If a tile is dead and has exactly 3 neighbors that are alive then the tile is alive in the next generation. This is called "reproduction".<br><br>I want to simulate this game but I don't know where to start. What kind of data structure should I use to simulate the grid? Also how would I do the updating?
Comments (9) 15111 👁️