Package Exports
- @monarchwadia/conways-game-engine
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@monarchwadia/conways-game-engine) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Conway's Game of Life
Author: Monarch Wadia
Introduction
This is a very simple implementation of Conway's Game of Life, whipped up in about ~5 hours. It features a node-compatible engine, configurable board height and width, and configurable rules.
The configurable rules are pretty interesting and are worth playing around with.
Read the changeblog!
Starting with v1.1.0 (which adds Typescript support), I'm documenting all changes to this project. You can read the changeblog here. I hope you enjoy it!
Usage
Configuring cellular automaton rules
Configuration Options
Below are configuration options with their default values.
const { ConwaysGameEngine, defaultRules } = require('@monarchwadia/conways-game-engine');
const config = {
// Width of the board.
// Defaults to 10.
rowSize: 10
// Height of the board.
// Defaults to 10.
colSize: 10,
// The cellular automata rules. The default is Conway's Game of Life.
// You can modify these. See "Configuring Rules" section.
// Defaults to the result of `defaultRules()`, which is called internally.
rules: defaultRules(),
// Usually, each cell can only match a single rule, otherwise it throws an error. Set to 'true' to allow multiple rules.
// Defaults to false.
allowMultipleRuleMatches: false
}
const engine = ConwaysGameEngine(config);