Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/andeemarks/game-of-life-ts

Typescript implementation of Conway's Game of Life simulation
https://github.com/andeemarks/game-of-life-ts

cellular-automata game-of-life nodejs simulation typescript

Last synced: 22 days ago
JSON representation

Typescript implementation of Conway's Game of Life simulation

Awesome Lists containing this project

README

        

[![-----------------------------------------------------](https://raw.githubusercontent.com/andreasbm/readme/master/assets/lines/fire.png)](#conways-game-of-life)

# ➤ Conway's Game of Life


Logo

game-of-life


Dependencies
Contributors


Typescript version of Conway's Game of Life simulation. Runs as a CLI application with no user interaction. Keeps track of the number of new cells that have spawned, died, or thrived per generation. Automatically stops when the environment reaches entropy (i.e., no further evolution).


[![-----------------------------------------------------](https://raw.githubusercontent.com/andreasbm/readme/master/assets/lines/fire.png)](#table-of-contents)

## ➤ Table of Contents

* [➤ Conway's Game of Life](#-conways-game-of-life)
* [➤ Usage](#-usage)
* [➤ Configuration](#-configuration)
* [➤ Dependencies](#-dependencies)
* [➤ Contributors](#-contributors)
* [➤ License](#-license)

[![-----------------------------------------------------](https://raw.githubusercontent.com/andreasbm/readme/master/assets/lines/fire.png)](#usage)

## ➤ Usage

To run the simulation: `yarn game.js`.

* **test**: yarn lint:types && jest --no-cache
* **lint**: yarn lint:types && yarn lint:ci
* **lint:types**: yarn tsc --noEmit -p .
* **lint:ci**: eslint src/* --ext .tsx,.ts
* **create**: yarn build
* **readme**: npx @appnest/readme generate
* **game**: yarn build && node lib/src/game-of-life.js
* **build**: tsc -p .

[![-----------------------------------------------------](https://raw.githubusercontent.com/andreasbm/readme/master/assets/lines/fire.png)](#configuration)

## ➤ Configuration

To see available configuration: `yarn --help`.

```
Presets

--blinker Simple simulation of constant blinker evolution
--glider Simple simulation of moving glider shape
--block 4 cell still life

Options

--width number Width of simulation in characters. Defaults to 20.
--height number Height of simulation in characters. Defaults to 20.
--delay ms Time in millis between evolutions. Defaults to 250.
-h, --help Print this usage guide.

Examples

1. All defaults. $ yarn game
2. A slower evolution. $ yarn game --delay 1000
3. A bigger simulation $ yarn game --width 25 --height 40
```

[![-----------------------------------------------------](https://raw.githubusercontent.com/andreasbm/readme/master/assets/lines/fire.png)](#dependencies)

## ➤ Dependencies

* **@types/clear**: ^0.1.2
* **@types/clui**: ^0.3.1
* **@types/command-line-args**: ^5.2.0
* **@types/command-line-usage**: ^5.0.2
* **@types/figlet**: ^1.5.4
* **box-console**: ^2.0.0
* **chalk**: ^4.1.0
* **clear**: ^0.1.0
* **clui**: ^0.3.6
* **command-line-args**: ^5.2.0
* **command-line-usage**: ^6.1.1

[![-----------------------------------------------------](https://raw.githubusercontent.com/andreasbm/readme/master/assets/lines/fire.png)](#contributors)

## ➤ Contributors

| [Andy Marks](https://twitter.com/andeemarks) |
|:--------------------------------------------------:|
| [[email protected]](mailto:[email protected]) |

[![-----------------------------------------------------](https://raw.githubusercontent.com/andreasbm/readme/master/assets/lines/fire.png)](#license)

## ➤ License

Licensed under [MIT](https://opensource.org/licenses/MIT).