Programming classics in the browser
Programming classics
This page demonstrates the power of running Python directly in the browser using WebAssembly. Select a demo from the dropdown below to see it in action.
About the Technology
This project uses Pyodide, a port of CPython to WebAssembly (WASM), to run Python code directly in your browser. The visualizations are rendered on an HTML5 Canvas, with Python interacting with the JavaScript DOM via Pyodide's foreign function interface (FFI).
Gallery
Each visualization below is a direct port of a Python script originally designed for a terminal environment (using curses). They have been adapted to draw to a shared canvas context instead.
Game of Life
Conway's Game of Life, the most famous cellular automaton, was devised by British mathematician John Horton Conway in 1970. It demonstrates how complex, emergent behavior can arise from simple local rules.
Loading visualization...
Langton's Ant
A 2D universal Turing machine with a very simple set of rules, invented by Chris Langton in 1986. It is known for its emergent 'highway' behavior after a period of chaotic motion.
Loading visualization...
Boids Flocking
An artificial life program developed by Craig Reynolds in 1986. It simulates the flocking behavior of birds through three simple steering behaviors: separation, alignment, and cohesion.
Loading visualization...
3D Donut
A spinning 3D torus rendered entirely with ASCII characters. This specific algorithm and its compact C implementation were popularized by Andy Sloane (a1k0n) in 2006.
Loading visualization...
Doom Fire
The iconic fire effect used in the PlayStation port of Doom (1995). The algorithm uses a simple particle-like system to propagate heat upwards with random cooling.
Loading visualization...
Mandelbrot Set
Discovered in 1980 by Benoit Mandelbrot at IBM, this set is the most famous example of fractal geometry. It is generated by a simple iterative formula on complex numbers.
Loading visualization...
Matrix Rain
The digital rain effect created by Simon Whiteley for the 1999 movie 'The Matrix'. It has become a symbol of cyberpunk aesthetics and simulated reality.
Loading visualization...
Sorting Algorithms
A comparison of Bubble Sort (formalized in the 1950s) and Quick Sort (invented by Tony Hoare in 1959). It visualizes the stark difference in efficiency between O(n²) and O(n log n) algorithms.
Loading visualization...
Starfield
A classic visual effect from the 1980s 8-bit and 16-bit computer era. It was a staple of early demoscene 'cracktros' and space exploration games like Star Control.
Loading visualization...
ASCII Pattern
Inspired by the 'plasma' demo effects popular in the 1990s demoscene. It uses sine wave superposition to create organic, shifting patterns using a limited character set.
Loading visualization...
Maze Generator
Utilizes the Recursive Backtracker algorithm, a randomized version of Depth-First Search. This technique has been used for decades in procedural level generation for games.
Loading visualization...
Raycaster 3D
The rendering technique popularized by John Carmack for Wolfenstein 3D (1992). It allows for fake 3D environments on hardware that wasn't powerful enough for true 3D.
Loading visualization...
Tetris
The world-famous puzzle game created by Soviet software engineer Alexey Pajitnov in 1984. It was the first entertainment software to be exported from the USSR to the US.
Loading visualization...