Skip to content

PeterHancock/react-ink-game-of-life

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

React Ink Demo - Game of Life

This project demonstrates using Ink to build command-line interfaces with React components, including JSX and TypeScript support.

Game of Life was implemented to performance test multiple Text and Box components

     Game of Life

╭───────────────────────────────────────────────────────────╮
│  ■ ■             ■ ■   ■ ■       ■ ■ ■ ■ ■     ■ ■ ■ ■   ■│
│■ ■                 ■ ■ ■ ■       ■ ■   ■ ■     ■       ■ ■│
│■ ■       ■         ■ ■   ■ ■ ■ ■   ■ ■ ■   ■ ■ ■       ■  │
│  ■ ■     ■         ■   ■       ■ ■   ■ ■ ■     ■ ■ ■ ■ ■ ■│
│■         ■ ■       ■   ■       ■ ■ ■ ■   ■         ■ ■   ■│
│            ■ ■ ■ ■   ■ ■           ■ ■ ■ ■ ■ ■     ■ ■ ■ ■│
│              ■ ■ ■ ■ ■   ■ ■       ■   ■   ■ ■ ■ ■ ■   ■ ■│
│■             ■ ■ ■     ■   ■ ■ ■ ■ ■ ■ ■ ■     ■ ■   ■ ■  │
│■     ■       ■   ■     ■ ■   ■   ■   ■   ■       ■ ■ ■   ■│
│■ ■ ■ ■ ■ ■ ■ ■ ■ ■       ■ ■ ■ ■ ■ ■ ■ ■ ■ ■     ■ ■   ■ ■│
│  ■ ■   ■ ■ ■   ■ ■       ■ ■               ■ ■ ■ ■   ■ ■  │
│  ■ ■ ■ ■   ■ ■ ■ ■       ■ ■                 ■ ■   ■   ■  │
│■ ■     ■ ■   ■   ■       ■ ■                   ■ ■ ■ ■   ■│
│■ ■     ■ ■ ■   ■       ■   ■       ■           ■ ■     ■  │
│        ■     ■ ■       ■ ■       ■ ■         ■ ■ ■     ■ ■│
│        ■     ■   ■ ■ ■ ■ ■       ■ ■         ■   ■ ■ ■   ■│  Generation 19
│■     ■ ■ ■ ■ ■ ■     ■       ■ ■   ■         ■ ■ ■ ■   ■ ■│
│■     ■ ■ ■ ■   ■     ■     ■ ■   ■ ■ ■ ■ ■ ■ ■     ■ ■ ■  │
│■       ■   ■ ■   ■ ■ ■       ■ ■ ■   ■   ■ ■       ■ ■ ■ ■│
│  ■     ■ ■ ■   ■     ■       ■ ■   ■ ■ ■ ■       ■ ■     ■│
│■ ■     ■   ■ ■ ■     ■     ■ ■   ■ ■   ■ ■       ■ ■     ■│
│      ■   ■ ■     ■ ■ ■     ■   ■ ■ ■ ■ ■   ■     ■ ■      │
│      ■ ■     ■ ■   ■ ■     ■ ■ ■         ■ ■     ■ ■      │
│              ■ ■ ■   ■ ■ ■ ■             ■ ■ ■ ■ ■   ■ ■  │
│  ■ ■ ■     ■ ■   ■ ■ ■   ■                     ■ ■ ■   ■  │
│  ■ ■   ■ ■ ■   ■ ■ ■   ■ ■         ■ ■             ■ ■    │
│  ■   ■   ■   ■ ■   ■ ■ ■ ■       ■                        │
│  ■ ■ ■ ■   ■ ■   ■ ■ ■   ■ ■ ■ ■ ■                        │
│  ■ ■   ■ ■ ■ ■ ■ ■   ■ ■   ■ ■ ■                          │
│■   ■ ■ ■ ■       ■ ■ ■   ■                         ■ ■ ■ ■│
╰───────────────────────────────────────────────────────────╯

Enter grid size (10-50) ❯ 30
Press Enter to submit, ctr-c to exit

Features

  • React-style CLI components with Ink
  • JSX and TypeScript support
  • Double-buffered drawing example using ArrayBuffers

Getting Started

Prerequisites

  • Node.js (v14+ recommended)
  • npm

Installation

npm install

Run

npm start

License

MIT

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published