Skip to content

jadhaidar/ts-hashlife

Repository files navigation

ts-hashlife

Efficient TypeScript implementation of HashLife, an optimized algorithm for simulating Conway's Game of Life with memoization and quadtree-based compression.

Installation

npm install ts-hashlife
# or
yarn add ts-hashlife
# or
pnpm add ts-hashlife

Features

  • Implements the HashLife algorithm for Conway's Game of Life
  • Written in TypeScript with full type definitions
  • Supports both Node.js and browser environments
  • Highly optimized for simulating large, sparse patterns
  • Includes utilities for drawing and importing/exporting Life patterns

Credits

This implementation is based on copy/life by Fabian Hemmer, a JavaScript implementation of the HashLife algorithm. The original project provided the foundation and core algorithm that this TypeScript implementation builds upon.

License

BSD-2-Clause

This project contains code from the copy/life project, which is also licensed under the BSD-2-Clause license.