N Queens
Placed: 0 / 8
Conflicts: 0
Rules
Place one queen per row so that no two queens share a column or diagonal. Click a square to place a queen, click it again to remove it.
Reading the board
A queen with a red dashed outline and a "!" badge is under attack. The hatched squares show the row, column, or diagonal line an attack travels along.
Row: 0
Placements tested: 0
Backtracks: 0
How Backtracking Works
- Each row is a variable the algorithm must assign — one queen per row.
- The columns in that row are the possible values it tries, left to right.
- Queens can't share a column or diagonal — a clash rejects that column immediately.
- When a row runs out of safe columns, the algorithm backtracks: it removes the previous row's queen and tries that row's next column.