4square Play ▶

About 4square

A free puzzle game about the Four Colour Theorem, playable in any browser

4square is a puzzle game where every move is a Kempe chain swap, the move at the heart of the 150-year story of the Four Colour Theorem. It runs in the browser on phones, tablets and computers, installs to a home screen, and works offline once loaded. There is nothing to buy and no sign-up.

Who makes it

4square is made by Kyle Mathewson. It grew out of GraphColourDeductiveSolver, an open research project on the Four Colour Theorem, and turns that project's data into levels anyone can play. The whole game is open source at github.com/kylemath/4Square, and it is updated regularly: levels 41 to 52 were added in October 2026.

Where the levels come from

The maps are sphere triangulations: maps on a globe where every corner joins three regions. Research code enumerated all of them up to 34 regions (billions of maps) and, for each hole with five neighbours, explored every colouring to find the hardest starting positions. Those records became levels: the π loops where the forced swap cycles forever, the six-ring traps, and the deepest pit known, six swaps from a solution. The last levels are built around the pieces that a 2026 computer proof search could not rule out. See the level guide for every level and the maths for the background.

Every level's par is exact: the build computes the shortest way out by searching the whole space of colourings, and automated checks confirm each level's story (for example that a loop really is 20 swaps long) every time the game is rebuilt.

One puzzle, nineteen styles

The same levels can be played in different styles, each with its own look, rules screen and coins. A new player starts with Islands and unlocks the others with skin tickets earned by playing.

Islands, Islands Free and Islands 3D
The map as a tropical island of tiles, with walls, as soft bubbles, or as a three-dimensional scene.
Dots, Line Doodle, Blank Doodle and Island Map
The map redrawn as a graph you trace with one finger, as a felt-tip drawing to colour, as a blank map to paint, or as an atlas where you drag across borders.
Rat Maze
The space of colourings drawn as a maze: every room is a colouring and every door is a swap. Find the cheese.
Candy, Bonus Swipe, Ion Channels and Gran's Table
The swap in disguise: swap two candies and the chain ripples through, swipe pairs of casino chips, move glowing ions in a living cell, or seat guests at four tables with one seat left for Gran.
Rim Word
Every colouring near the start gets a five-letter label so that the winning colourings spell real words.
Spheres, Gears and Signs
Glossy balls on sticks, trains of meshing gears that drive a hub with a die counting the colouring's degree, and triangles of sun and sea that flip when a chain is swapped.
Star, Shoreline and Respawn
The rim as a star you climb through, a sea where only chains touching the shore can move, and a run through rooms against a burning fuse.

Research

With your permission the game can record how levels are played (moves and timings, no names) to study how people solve these puzzles; see privacy. The same levels also feed experiments with learning agents in the companion research project.

Contact

Questions, bug reports and level ideas are welcome: see the contact page.

Play 4square ▶