The Eight Queens Puzzle asks you to place eight chess queens on a standard 8×8 chessboard so that no two queens can attack each other. Before you can solve it, you need to understand exactly how a queen moves — and what "non-attacking" really means.
What Can a Queen Do?
In chess, a queen is the most powerful piece on the board. She can move any number of squares in eight directions:
- Horizontally — left or right across an entire row
- Vertically — up or down an entire column
- Diagonally — in all four diagonal directions, for as many squares as the board allows
This makes the queen extremely powerful — and extremely dangerous to place near another queen. Two queens that share a row, column, or diagonal can attack each other.
What Does "Non-Attacking" Mean?
Two queens are "non-attacking" if they cannot reach each other in a single move. For the puzzle to be solved, every pair of queens must satisfy this condition simultaneously. With eight queens on the board, that means checking 28 pairs (8 choose 2 = 28 combinations) all at once.
The Three Conflict Types
When you place queens, watch out for three types of conflict:
- Row conflict: Two queens share the same row. Easy to spot — just scan the row horizontally.
- Column conflict: Two queens share the same column. Also easy — scan vertically.
- Diagonal conflict: Two queens share a diagonal line. This is the hardest conflict to detect by eye, and the most common source of errors for beginners.
A helpful rule: on an 8×8 board, two squares are on the same diagonal if the absolute difference between their row numbers equals the absolute difference between their column numbers. For example, a queen at row 2, column 3 is on the same diagonal as a queen at row 5, column 6 (both differ by 3).
The Scale of the Problem
There are 4,426,165,368 ways to place 8 queens on a 64-square board. Of those, only 92 are valid solutions where no queen attacks another. That sounds daunting, but with the right strategies you can find solutions quickly — often in under a minute. You can explore all all 92 solutions once you understand the methods.