Game of Life rules
Implemented the rules of Game of Life:
- Each cell is either “dead” (black) or “alive” (white)
- If an alive cell has more than 3 alive neighbours it dies of crowding
- If an alive cell has less than 2 alive neighbours it dies of loneliness
- If a dead cell has exactly 3 alive neighbours it becomes alive
Each frame is then decided based on the state of the previous.
You can see some “glider” patterns emerging from the randomly generated soup!
Comments 0
No comments yet. Be the first!
Sign in to join the conversation.