Queens

Queens puzzle: play a board and learn the techniques

Place one queen in every row, every column and every colored region, with no two queens touching. Every board below has exactly one answer, and the Hint button tells you why a move works before it makes it.

Start here: a 6 by 6 board

Tap a cell once to cross it out, twice to place a queen, and a third time to clear it. The small letter in each corner names the region, so you never have to rely on color alone. When two queens clash, the cells between them get stripes. With a keyboard, Tab moves through the cells and Enter changes the one you're on.

The rules

A board of n by n cells is split into n colored regions. You place n queens so that:

  • every row has exactly one queen,
  • every column has exactly one queen,
  • every colored region has exactly one queen,
  • and no two queens touch, not even at a corner.

That last rule trips people up who know chess. A queen here doesn't attack along long diagonals. It only blocks the eight cells right around it, plus its own row, column and region. So two queens can sit on the same diagonal as long as there's a gap between them.

If you play the daily Queens game on LinkedIn, these are the same rules. Star Battle is a close cousin. In two star Star Battle, every row, column and region holds exactly two stars, and stars can't touch, even diagonally.

How these boards are made

The boards come from the engine I wrote for my Queens app. It places the queens first, grows the colored regions around them, and then keeps adjusting single cells until only one answer is left. After that a second pass solves the board the way a person would, one deduction at a time, and throws the board away if it ever needs a guess.

So every board on this page has exactly one answer, and you can always reach it with logic. The 6x6 boards only need the first two or three techniques below. The 9x9 boards can need all of them.

The Hint button runs that same solver on your board. It first checks your queens and crosses against the answer, then finds the simplest next step and tells you which technique it is. Tap Hint a second time and it makes the move for you.

The techniques, easiest first

Each example below is a real board from the engine, frozen at the moment the technique applies. Outlined cells are the part of the board to look at. Striped cells with a cross are the ones the step rules out.

1. Last cell

This is where every queen eventually comes from. When a region, row or column has only one cell left that isn't crossed out, its queen has to go there. Small regions are the place to look first: a region of one or two cells is almost a free queen.

Last cell. Only one cell of region D isn't crossed out, so its queen goes on row 2, column 6.

After you place a queen, cross out its whole row, its column, its region and the eight cells around it. Doing that every single time is what turns one queen into the next last cell.

2. Region in one line

Look for a region that lies entirely inside one row or one column. Its queen must be somewhere in that line, and the line can only hold one queen. So no other region can use that line, and you can cross out every cell of it that belongs to someone else.

Region in one line. Every cell of region E sits in one row. That row has to give its queen to region E, so the 4 marked cells can't hold a queen.

It comes up a lot on small boards. Long thin regions are the giveaway.

3. Line in one region

The mirror image. If the open cells of a row or column all belong to one region, that line's queen is also that region's queen. The rest of the region can't hold a queen anymore.

Line in one region. Every cell of column 1 that's still open belongs to region A. The queen of column 1 is region A's queen, so the 6 marked cells elsewhere in region A are out.

4. No room

Sometimes a cell is wrong because of what it would do to a neighbor. Pick a region, row or column with only a few open cells left. Now look for a cell outside it that touches or lines up with all of them. A queen there would leave the group with nowhere to go, so that cell is out.

No room. A queen on either marked cell would cover every open cell of region A, and region A still needs a queen. So neither marked cell can hold one.

The quickest way to spot this: find a group whose open cells form a tight cluster of two or three, then check the cells hugging that cluster.

5. Regions fill lines

This is technique 2 with more than one region. If two regions fit together inside the same two rows, those two rows hold exactly their two queens. Every other region loses those rows. The same goes for three regions in three rows, or columns instead of rows.

Regions fill lines. Regions B and E fit entirely inside rows 1 and 2. Two regions in two rows use up both queens there, so the 4 marked cells from other regions are out.

It works the other way round too. If two columns only have open cells in two regions, those columns supply the queens of both regions, and the rest of those two regions is out.

Lines fill regions. The open cells of rows 1 and 2 all belong to regions B and F. Those two rows supply the queens of both regions, so the 2 marked cells of B and F outside them are out.

On 8x8 and 9x9 boards this is often the step that gets a stuck board moving again. Count regions against rows: when a set of k regions only touches k rows, you've found one.

6. Dead end

When nothing simpler works, test a cell. Imagine a queen there, cross out what it covers, and follow only the forced moves from techniques 1 to 3. If some region, row or column ends up with no open cell at all, the queen you imagined was impossible, and you can cross that cell out for real.

Dead end. Suppose a queen stands on row 1, column 1. The forced moves that follow leave region A with no open cell at all, which can't happen. So that cell is out.

This isn't guessing. You aren't hoping the queen is right; you're proving a cell is wrong. Keep the chain short enough that you could explain it to someone. A long chain is easy to get wrong in your head.

A routine for these boards

  1. Start with the smallest regions.

    A region of one cell is a queen. A region of two or three cells often lies in one line.

  2. Cross out after every queen.

    Row, column, region and the eight neighbors. Most mistakes come from skipping this.

  3. Scan rows, then columns, for regions that fit in one line.

    Then flip it: lines whose open cells sit in one region.

  4. Check tight clusters for no room.

    Two or three open cells close together usually rule out the cells around them.

  5. Count regions against lines.

    Two regions inside two rows, three inside three. This is the big one on larger boards.

  6. Only then test a cell.

    Pick a cell in a group with two options and follow the forced moves.

Mistakes I see most

Forgetting the corners. The no touching rule covers diagonal neighbors too. A queen in row 3, column 3 rules out row 2, column 2, even though they're in different rows, columns and maybe regions.

Treating it like chess. Two queens on the same long diagonal are fine as long as they don't touch. If you've been crossing out whole diagonals, you've been throwing away cells that might hold the answer.

Placing a queen to see what happens. Testing is fine in your head (that's the dead end technique). Placing a queen you aren't sure about and building on it is how a board gets tangled. Cross cells out, and let the queens come from last cells.

Questions

Is this the same puzzle as Queens on LinkedIn?

The rules are the same: one queen per row, column and colored region, and no two touching. These boards are my own, made by my engine, so you won't find LinkedIn's daily board here.

Does every board have only one answer?

Yes. The engine checks every board with a full search for a second answer before it shows it to you, and it also checks that the board can be solved by the techniques on this page without guessing.

How is this different from the eight queens problem?

The eight queens problem is about chess queens on an empty 8x8 board, so queens attack along every diagonal and there are no regions. Here a queen blocks its whole row, column and region plus the cells right around it, but distant diagonals stay open. And my generator checks that each region layout has exactly one solution.

Can I play without the hints?

Of course. The hint only appears when you tap the button, and it explains the step before it changes your board, so you can stop reading and try it yourself.

Is there a version for my phone?

Yes. My Queens app for Android has 680 boards from 5x5 up to 11x11, a daily board and the same explained hints. It works offline.

All puzzles
Code breaker

Bulls and cows solver

Enter your guesses and their bulls and cows. See every code that still fits and a suggested next guess.

Solver
Code breaker

How to solve code breaker puzzles

One method for lock riddles, daily vaults and bulls and cows, with three puzzles solved step by step.

Solving guide · 9 min read