KOJP

N Queens Puzzle Online Game

The classic puzzle of placing queens on a chessboard so that none can attack another. Boards from 4×4 to 10×10, a color region variant with one queen per region, and an album for all 92 solutions on 8×8

4×4 to 10×10 · Classic · Color regions · Time trial · Daily · Album

A queen attacks along rows, columns and diagonals all the way to the edge. When you place one, its lines of attack flash out like lasers, and queens that attack each other turn red. Place as many queens as the board is wide with no clashes to finish. Your game in progress, best times and found solutions are saved in this browser.

Controls

Tap a square: place or lift a queen
Color regions: drag to mark ✕, or switch on ✕ Mark to mark with each tap
Undo, Hint and Clear buttons
Arrows and Enter place · X mark · Z undo · H hint · C clear

What is the eight queens puzzle?

The eight queens puzzle asks you to place eight queens on an 8×8 chessboard so that no two queens attack each other. On other board sizes it is called the N queens problem.

The queen is the strongest chess piece and moves any distance in eight directions: along its row, its column and both diagonals. To fit eight queens, every row and every column must hold exactly one queen, and no diagonal may hold two. In this game each queen lands with its attack lines shooting out like lasers, the squares it covers fall into shade, and a red line flickers between any two queens that see each other. When the last queen lands safely, the ivory queens glow gold and their crown tips sparkle one by one.

How many solutions does each board have?

The 8×8 board has 92 solutions, or 12 basic solutions if you count turns and flips of the same pattern as one. Boards of 2×2 and 3×3 have no solution, and solutions begin at 4×4.

BoardAll solutionsBasic solutions (symmetry removed)
4×421
5×5102
6×641
7×7406
8×89212
9×935246
10×1072492

Notice that 6×6 has fewer solutions than 5×5, so a bigger board is not always easier. A basic solution usually gives eight shapes through four turns and a flip, but one of the twelve 8×8 basics looks the same after a half turn and gives only four, which is why 11×8 + 4 = 92. The game keeps count of the solutions you find on every board size and shows 8×8 as twelve cards in the album.

Which ways are there to play?

There are five: Classic, Color regions, Time trial, Daily puzzle and the Solution album.

How is the color region mode different?

In color regions each colored region must hold one queen and no two queens may touch in any of the eight directions. The rule comes from the logic puzzle Star Battle and is widely played today as the queens puzzle.

The classic puzzle has many answers and is about exploring, while the region version has exactly one answer and is about deduction. Tiny regions of one or two squares often fix a queen at once, and crossing out the rows and columns it blocks reveals the next spot. Drag a finger or the mouse to stamp ✕ on every square you pass, or switch on ✕ Mark to place a ✕ with each tap.

Who first posed the eight queens puzzle?

It was first published in 1848 by the German chess composer Max Bezzel in a chess magazine. In 1850 Franz Nauck published all 92 solutions and extended the question to N×N boards.

Mathematicians went on to study the number of solutions and their symmetries, and with the arrival of computers the puzzle became the standard example of backtracking search. Edsger Dijkstra famously worked through it in 1972 to explain structured programming, and it is still one of the first problems students meet when they learn recursion and backtracking.

Any tips for solving faster?

  1. Fill one row at a time. Eight queens must sit in eight rows, so working down from the top row keeps you from missing a gap.
  2. Look only at unshaded squares. Squares a queen covers get shade and a dot. If a remaining row has no unshaded square, that path is already dead, so undo right away.
  3. Try knight's steps. On larger boards, chaining queens one row down and two columns across, the way a knight jumps, quickly gets you close to a solution.
  4. In color regions, start with small or straight regions. If a region lies within a single row or column, every other square of that line can be crossed out.
  5. Use a hint when stuck. The hint flashes a queen to lift in blue when one clashes or leads nowhere, and otherwise flashes the next square to fill in yellow.

Controls

Your game in progress, best times for each board, found solutions and the album are stored only in this browser and never sent to a server. Anyone who opens a link from Share result in color regions can try the same board.

Frequently asked questions

Is the N Queens Puzzle free?

Yes. You can play it free on this page with no sign up, on a computer, phone or tablet.

How many solutions does the 8×8 board have?

There are 92. Grouping the ones that match after a turn or a flip leaves 12 basic solutions, and the album lets you fill those 12 cards.

How far does a queen attack?

All the way to the edge in eight directions: along its row, its column and both diagonals. Two queens may never share a row, column or diagonal, and the laser lines show this the moment you place a queen.

What are the color region rules?

Every row, every column and every colored region holds exactly one queen, and queens may not touch, including corner to corner. Unlike the classic rule, distant diagonals do not matter. Every board has exactly one answer.

How do I change the board size?

Use the arrows on the title screen to pick from 4×4 to 10×10. The size is used for Classic and Color regions, and region boards start at 5×5.

How does the time trial work?

You solve five boards in a row from 5×5 up to 8×8 and race the clock. Each board starts with one fixed ebony queen, and every hint adds 10 seconds.

What can I do when I am stuck?

Undo takes back one move and Clear empties the board. Hint flashes a queen to lift in blue or the next square to fill in yellow.

What is special about the daily puzzle?

Everyone gets the same 8×8 color region board for the day. It changes at midnight Korea time, and your time is saved in the daily check in record.