Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bdeering1/clj-conway
Conway's Game of Life implemented in Clojure
https://github.com/bdeering1/clj-conway
Last synced: 2 days ago
JSON representation
Conway's Game of Life implemented in Clojure
- Host: GitHub
- URL: https://github.com/bdeering1/clj-conway
- Owner: Bdeering1
- License: other
- Created: 2024-04-01T03:34:49.000Z (10 months ago)
- Default Branch: main
- Last Pushed: 2024-06-15T16:28:15.000Z (8 months ago)
- Last Synced: 2024-12-09T15:13:53.495Z (about 2 months ago)
- Language: Clojure
- Homepage:
- Size: 20.5 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# clj-conway
[Conway's Game of Life](https://conwaylife.com/wiki/Conway%27s_Game_of_Life) (CGL) implemented in Clojure.
CGL is a discrete event simulation played out on a 2D grid of points (or "cells"), where at any slice of time each cell is either alive or dead. Each iteration, the next state of each cell is determined by a simple set of rules:
1. Any living cell with less than two neighbours dies due to underpopulation.
2. Any living cell with more than three neighbours dies due to overpopulation.
3. Any living cell with two or three neighbours lives on to the next generation.
4. Any dead cell with exactly three living neighbours will come to life.## Usage
Run using the provided jar file (in the "releases" tab), or build from source.
To build from source, you'll need [leiningen](https://leiningen.org/).
Once installed, cd into the project directory and run using:
```
lein run -m clj-conway.core
```Once running, toggle points by clicking on the grid, and play/pause the simulation by pressing space.
Some other controls:
| Keybind | Action |
|------------|--------------------|
| ↓, ↑, ←, → | pan |
| -, + | zoom in/out |
| 0 | clear grid |
| 1-5 | load template |
| c | reset pan (center) |
| r | reset pan + zoom |
| x | toggle 2x speed |*this project was developed using Java Temurin 17, but should work with other versions of Java as well