Unruly (Simon Tatham's Puzzles)
Saved games stay in this browser only.
About the puzzle
Unruly is a grid of squares, a few of them already black or white. Fill in the rest with black and white so that every row and every column is evenly split between the two colours, and nowhere do three squares of the same colour sit next to each other in a line.
The puzzle was invented by Adolfo Zanellati, who named it Tohu wa Vohu, and it is also widely played as the binary puzzle, written with 0s and 1s. Lennard Sprong contributed this version to the collection.
Rules
- Every square is black or white.
- Each row and each column has the same number of black and white squares (so the grid's sides are always even).
- No row or column has three squares of the same colour in a row.
- With the Unique rows and columns option from Custom, no two rows may be identical, and no two columns either.
Controls
| Input | Action |
|---|---|
| Left click | empty to black, then white, then empty again |
| Right click | empty to white, then black, then empty again |
| Middle click | empty the square |
| Arrow keys | move the cursor |
| Enter / Space | act as a left / right click on the cursor's square |
| Backspace | empty the square under the cursor |
| N / U / R | new game / undo / redo |
How to solve it
Pairs get capped. Two squares of the same colour side by side force the squares at both ends of the pair to be the other colour.
Gaps get filled. Two squares of the same colour with one space between them force the space to be the other colour.
Count each line. In an 8-wide row, four squares are black and four white. As soon as a row has its four blacks, the rest is white, and when only a few squares are left, counting usually decides them.
Count with the triple rule. If a row needs one more black and has three empty squares together, putting the black at an end might force three whites in a row elsewhere. Testing each position against the no-three rule often leaves only one place.
Higher levels need lookahead. Normal grids sometimes require thinking a couple of moves ahead: try a colour mentally and see whether it breaks a count or makes a triple further along.
Sizes and difficulty
The Type menu has 8x8 grids at Trivial, Easy and Normal, and 10x10 and 14x14 at Easy and Normal. Custom sets any even width and height, the difficulty and the Unique rows and columns rule.
Playing here
Click Play to open the puzzle. The menu above the board has New game, Restart, Undo, Redo and Solve (which you can undo to keep going on your own), the Type menu with the sizes, and the Game menu, where you can type in a game ID or a random seed, download the current game as a file, load a saved file and change the preferences. Your game in progress is kept in this browser and comes back with its whole undo history the next time you open the page.
On a touch screen, tap a square to turn it black; turn on the Mark button above the board to turn squares white instead.
Credits and licence
Unruly was written by Lennard Sprong for Simon Tatham's Portable Puzzle Collection, which Simon Tatham maintains with code contributed by several other authors and distributes with its source code under the MIT licence. This page runs a WebAssembly build made by FredyGames from the author's official source snapshot, with no changes to the puzzle; the source and the build script are hosted with the game, and the licence text is linked from this page.