Eight Queens puzzle

Put eight queens on the board so that no queen can capture another. It sounds simple. Most people need a few tries.

How to play

Tap a square to place a queen and tap it again to pick it up. A queen attacks every square in its row, its column and both diagonals, so no two queens can share any of those lines. Squares under attack turn red, and queens that can see each other are joined by a dashed red line.

When all the queens are safe, you've solved it and the solution goes into your collection. Then clear the board and look for a different one. For a tougher challenge, switch on hard mode: the attack hints disappear and you only find out if you were right once every queen is down.

How many solutions are there?

On a normal 8×8 chessboard there are exactly 92 ways to place eight queens safely. Many of them are just mirror images or rotations of each other. If you count those as the same, there are only 12 truly different solutions. Smaller boards are a good warm up: 4×4 has just 2 solutions, 5×5 has 10, 6×6 has only 4, and 7×7 has 40.

A little history

The puzzle was first published in 1848 by the German chess composer Max Bezzel. Two years later Franz Nauck published the first full set of solutions, and the famous mathematician Carl Friedrich Gauss took an interest in it too. The general version, with n queens on an n×n board, has a solution for every size except 2×2 and 3×3.

In the age of computers the eight queens puzzle became a classic programming exercise. Computer scientist Edsger Dijkstra used it in 1972 to show how to solve a problem step by step with backtracking: place a queen, move on, and back up as soon as you hit a dead end. That is exactly how our hint button works.

Why it's good for your chess

To solve it you have to see every line a queen controls at once. That is the same skill you use in a game to spot pins, forks and loose pieces along long diagonals.