Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/marcusbuffett/game-of-life
Conway's Game of Life written in Haskell, using ncurses
https://github.com/marcusbuffett/game-of-life
Last synced: 3 months ago
JSON representation
Conway's Game of Life written in Haskell, using ncurses
- Host: GitHub
- URL: https://github.com/marcusbuffett/game-of-life
- Owner: marcusbuffett
- Created: 2015-06-30T20:30:31.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2016-10-24T20:51:17.000Z (over 8 years ago)
- Last Synced: 2024-09-28T04:49:18.037Z (4 months ago)
- Language: Haskell
- Size: 16.6 KB
- Stars: 4
- Watchers: 3
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Game of Life with ncurses
This is an implementation of Conway's Game of Life written in Haskell, using ncurses for display.
[![asciicast](https://asciinema.org/a/6btsatbsu46jx2c0t92xtb8fg.png)](https://asciinema.org/a/6btsatbsu46jx2c0t92xtb8fg)
# Installation
Installing from Hackage requires a working cabal installation (or stack):
```bash
cabal update
cabal install game-of-life
game-of-life # Make sure ~/.cabal/bin is in your path
```# Running / Testing
First, install stack. `curl -sSL https://get.haskellstack.org/ | sh` will work on most Unix systems, otherwise checkout https://docs.haskellstack.org/en/stable/README/ . If you haven't run other Haskell projects on your system, the first time you try to build the project it may say you have to run `stack setup`; do so.
Note that you'll need the ncurses header files on your system. OS X should have these installed by default. Some Linux distros won't, running `sudo apt-get install libncurses-dev` (replace apt-get with package manager of choice) should fix any issues.
Running:
```bash
stack build && stack exec game-of-life
```Testing:
```bash
stack build && stack test
```Installing:
```bash
stack build && stack install .
```# Notes
- Currently doesn't handle resizing the shell during execution
- The screen doesn't update fast enough sometimes, causing tearing / lag / unresponsiveness. Seems to have more to do with ncurses / the shell than the speed of the simulation
- Some linux distros cause the program to crash (and mess up the user's shell since the ncurses cleanup commands don't run)