Skip to content

Latest commit

 

History

History
38 lines (22 loc) · 1.99 KB

README-EN.md

File metadata and controls

38 lines (22 loc) · 1.99 KB

Conway's Game of Life

Introduction

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.

App Features

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.

Key Features

  1. 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.

  2. 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.

  3. Reset the Life Grid A reset feature allows users to clear all life blocks from the current grid and start over with their creations.

Implementation Details

Chessboard Implementation

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.

Implementation of Swipe to Add/Delete

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).

Conclusion

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.