Conway's Game of Life is a zero-player game created by the British mathematician John Horton Conway in 1970. Played on an infinite two-dimensional grid, each cell in the grid evolves based on the states of its neighboring cells (alive or dead). The evolution of the game is determined solely by its initial state, requiring no further input from players. Despite its simple rules, Conway's Game of Life can produce incredibly complex behaviors.
This app is an implementation of Conway's Game of Life developed with Compose, offering intuitive touch controls and a range of features that allow users to easily explore the fascinating world of the game.
-
Touch and Swipe to Add/Remove Life Blocks Users can intuitively add or remove life blocks on the grid by touch and swipe gestures, designing the initial state with ease.
-
Start/Stop Evolution Simple control buttons enable users to start or stop the evolution process of the Game of Life, observing the dynamic changes of life blocks.
-
Reset the Life Grid A reset feature allows users to clear all life blocks from the current grid and start over with their creations.
The chessboard in the app is drawn using Compose's Canvas API, defining a grid area and filling squares within the grid to represent the presence of life blocks.
By listening for touch drag gestures (using Compose's detectDragGestures
), the app calculates the squares touched by the user and updates the life state of the squares based on the current action (add or delete).
Thank you for your interest in this project! If you have any suggestions or feedback, please feel free to contact us through GitHub Issues. We welcome contributions and discussions of all kinds.