01 / Sorting
Sorting Algorithm Visualizer
See how different sorting algorithms rearrange data. Each bar represents a value. watch them compare, swap, and settle into sorted order. The color indicates the current operation: comparing, swapping, sorted.
How sorting works
Sorting algorithms reorder elements by comparing and swapping values. Bubble sort repeatedly walks through the list, swapping adjacent elements. Merge sort recursively splits the array and merges sorted halves. Quick sort picks a pivot and partitions elements around it. The best general-purpose sorts run in O(n log n) time.
02 / Graph Search
Pathfinding Visualizer
Click on the grid to draw walls, then watch the algorithm explore the space to find the shortest path from start (green) to end (red). Compare how BFS guarantees the shortest path while DFS can get lost exploring dead ends.
Algorithm comparison
BFS (Breadth-First Search) explores all neighbors at the current depth before moving deeper. guarantees shortest path on unweighted grids. DFS (Depth-First Search) goes as deep as possible before backtracking. fast but no shortest-path guarantee. A* uses a heuristic (Manhattan distance) to intelligently explore. optimal and efficient. Dijkstra's explores by minimum cost. equivalent to BFS on unweighted grids but generalizes to weighted graphs.
03 / Cellular Automata
Conway's Game of Life
A zero-player game where cells live or die based on simple rules: a live cell with 2–3 neighbors survives, a dead cell with exactly 3 neighbors becomes alive. Click to toggle cells, or load a preset pattern and watch emergent complexity unfold.
The Rules
1. Any live cell with fewer than 2 live neighbors dies (underpopulation).
2. Any live cell with 2 or 3 live neighbors lives on.
3. Any live cell with more than 3 live neighbors dies (overpopulation).
4. Any dead cell with exactly 3 live neighbors becomes alive (reproduction).
These four rules produce infinite emergent patterns. from oscillators to self-replicating structures.
04 / Fractals
Mandelbrot Set Explorer
Click anywhere on the fractal to zoom in. The Mandelbrot set is generated by iterating z = z² + c for each pixel and checking whether the value escapes to infinity. Points that never escape are "in the set" (black). The colors represent how quickly each point escapes.
About the Mandelbrot Set
Discovered by Benoît Mandelbrot in 1980, this set is one of the most famous objects in mathematics. It's defined in the complex plane: for each point c, we iterate z_{n+1} = z_n² + c starting from z_0 = 0. If the sequence stays bounded, c is in the set. The boundary is infinitely complex. no matter how far you zoom, you'll find self-similar structures at every scale.
05 / Emergent Behavior
Particle Life Simulation
Multiple species of particles attract or repel each other based on a random rule matrix. Despite the simplicity, complex life-like behaviors emerge: cells, chasing, clustering, and symbiotic orbits.
How Particle Life works
Each species pair has an attraction value between -1 (strong repulsion) and +1 (strong attraction). These forces only act within a certain radius. The interaction matrix is randomized each restart. Red might attract green while green repels red. this asymmetry creates predator-prey dynamics and emergent structures that look eerily organic.