A living experiment

Game of Life.

Small rules. Unexpected worlds. Change the ClojureScript, then watch your rules come to life.

Generation 0Alive 0
Your browser needs canvas support to display the simulation.

Click or tap a cell to toggle it, even while playing. Keyboard: focus the board, use arrow keys to choose a cell, then Enter or Space to toggle.

Pattern descriptions assume Conway’s rules. Edges and your edits can change their evolution. Reset board restores the selected seed.

Write the next generation

Conway’s rules

For each cell, this function receives alive? and its number of live neighbours. Return true to keep it alive, or false to let it die.

Try (fn [alive? neighbours] alive?) to freeze the board. You can define helpers inside a let or do expression. Ctrl/⌘ + Enter applies your code.

Loading ClojureScript…

How it works

Real ClojureScript compiles and runs in your browser. Applying a rule pauses the simulation; press Play when you’re ready. Invalid code leaves the previous rule in place. Slow or looping code is stopped in a worker so the page stays responsive.

The playground includes cljs.core. Additional library imports and DOM access are not available in the rule worker. The default engine and patterns are shared with the JVM desktop application.