← Back to Home

How Conway Canvas Works

Overview

Conway Canvas is a single-page web application that runs entirely in the browser. There is no server-side computation — everything from the simulation engine to the pattern library is handled client-side using vanilla JavaScript and the HTML5 Canvas API.

This page gives you a behind-the-scenes look at the key systems that make Conway Canvas work.

The Simulation Engine

At the heart of Conway Canvas is a HashSet-based Game of Life engine. Instead of storing the entire grid as a 2D array (which would waste memory on empty cells), we only track living cells in a JavaScript Set.

How a generation step works

This sparse representation means Conway Canvas can handle patterns with thousands of living cells on a grid that is effectively infinite — no fixed boundaries, no wrapping.

Rendering with HTML5 Canvas

The visible grid is drawn on an HTML5 <canvas> element. On every frame, the renderer:

Panning and zooming are handled via mouse drag, scroll wheel and touch gestures (pinch-to-zoom). The coordinate system smoothly translates between screen pixels and grid cells.

Pattern Library & RLE Format

Conway Canvas ships with a built-in library of 120+ classic Game of Life patterns, organized into categories:

Patterns are stored internally as coordinate arrays. Import and export use the RLE (Run Length Encoded) format — the standard format used by the Game of Life community and LifeWiki.

Drawing & Editing Tools

Conway Canvas provides a creative toolset beyond simple cell toggling:

All drawing operations support undo/redo with a history stack, so you can freely experiment without fear of losing your work.

Progressive Web App (PWA)

Conway Canvas is a fully installable Progressive Web App. This means:

Performance & Optimization

Several techniques keep Conway Canvas fast, even with complex patterns:

Responsive Design & Touch Support

Conway Canvas adapts to any screen size:

All interactive elements meet minimum touch target sizes (44px) for comfortable use on touchscreens.

Open Standards

Conway Canvas is built on open web standards with zero dependencies:

The entire application is a single HTML file with inline CSS and JavaScript — lightweight, fast and easy to deploy.

▶ Try Conway Canvas now