Sudoku Explained

Advanced 8 min read

X-Wing with a third line

Everything you know about X-Wing survives the upgrade. The only change is that three lines stand in for two.

The short version

A Swordfish is an X-Wing with three lines instead of two. Three base lines, each with at most three homes for a digit, all of those homes contained within the same three perpendicular lines.

Three lines each need the digit. Three cover lines supply all three copies. So the cover lines are fully accounted for, and the digit can be deleted from them everywhere outside the nine intersections.

The shape

Pick a digit. Pick three parallel lines — columns, say. In each, the digit has at most three homes. Now check: do all of those homes fall inside the same three rows?

If yes, you have a Swordfish.

The "at most three" is important and frequently misread. A base column may have one, two or three homes. What it cannot have is a fourth home outside the cover rows, because then the digit could escape the pattern and the counting argument collapses.

Why it works

Three base columns, each of which must contain exactly one copy of the digit.

Suppose all homes in those columns lie within rows 1, 2 and 3. Column A puts its digit in one of those rows. Column B puts its digit in one of those rows. Column C does the same. That is three placements, distributed across three rows.

Can two of them land in the same row? No — a row contains the digit at most once. So the three columns must place their digits in three different rows, and since only rows 1, 2 and 3 are available, each of those rows receives exactly one.

Rows 1, 2 and 3 are therefore fully supplied. The digit cannot appear in any of them outside the three base columns.

This is the same exhaustion argument as X-Wing, with the pigeonhole made explicit. The count is what does the work: three lines, three homes, three slots.

A real board

In columns 3, 8, 9, 1 appears only in rows 3, 5, 7. Each of those 3 columns needs one 1, so every one of those rows gets its copy from them, and the rest of each row is cleared.

Digit 1, and the pattern runs on columns — which is worth noticing, because most solvers scan rows first and would miss this.

So the three columns each place a 1, and they must land one per row across rows 3, 5 and 7. Those rows are supplied. Now clear the rows outside the base columns:

Five eliminations from one pattern. Note that the base columns have only two homes each, not three — the pattern does not require a full three-by-three. It requires no fourth home, and two is comfortably within that.

The reason this reads as columns and not rows matters. Scanning rows would show the 1 in row 3 sitting in four different cells, which looks like no pattern at all. The columns are where the confinement is visible, and that is the direction the search has to run.

How to scan for one

Swordfish hunting is X-Wing hunting with one more line, and the same discipline applies.

  1. Take one digit. Never scan for shapes; scan for a number.
  2. Count homes per line. For the chosen digit, walk each column and record how many cells can hold it. Keep the lines with two or three.
  3. Group the candidates. If three columns all have their homes inside the same three rows, you have a Swordfish. If a fourth row is involved, keep looking.
  4. Check for a fourth home. One base column with a home outside the three cover rows kills the pattern. This is the step that gets skipped, and it is the only one that matters.
  5. Sweep the cover lines. Delete the digit from the three rows, outside the base columns. Then repeat the whole scan with rows and columns swapped.

A practical shortcut: Swordfish usually appear on a digit that already has several places filled. With five or fewer homes left on the board, the line counts are small and the pattern is easy to see. Start with the digit that appears most often.

The traps

Three cells mistaken for three lines. A Swordfish is not three cells in a row. It is three lines, each with up to three homes. Confusing the cell count with the line count produces eliminations that are not justified.

Eliminating inside the base. The base columns are where the digit must go; they have nothing to give up. All deletions happen in the cover rows, outside the base. Reversing this is the most common way to break a board with a valid pattern.

A base line with four homes. If one of the three columns has a fourth home in row 6, the digit can escape, and rows 1-3 no longer each get a copy. No pattern, no eliminations.

Assuming all nine intersections are filled. Several of them will be empty or already solved. The pattern is a statement about lines, not about a nine-cell block, and the board above has only six marked corners for exactly this reason.

Where to use it

Swordfish belong to the band where X-Wings have already been checked and come up empty. They are less common than X-Wings and considerably harder to see, because the nine-cell shape does not announce itself the way a rectangle does.

The realistic workflow is: sweep for X-Wings on every digit first, then sweep for Swordfish on the digits that remain unresolved. If both come up empty, the next step is usually a wing rather than a Jellyfish — Jellyfish are rarer still.

Questions people actually ask

What is a Swordfish in sudoku?

Three parallel lines where a digit has at most three homes each, all confined to the same three perpendicular lines. Each of the three base lines must place the digit, so the three cover lines are fully supplied.

Does every cell of the Swordfish need to contain the digit?

No. The pattern is defined by the lines, not by the cells. Some of the nine intersections will not have the digit as a candidate; that is allowed as long as no base line has a fourth home outside the cover lines.

How is Swordfish different from X-Wing?

X-Wing uses two base lines and two cover lines, producing four cells. Swordfish uses three of each and produces up to nine. The rule that eliminations happen in the cover lines is identical.

Which direction do the eliminations go?

From the base lines into the cover lines. If the base is three columns, you eliminate inside the three rows that cross them, outside the columns. Getting this backwards is the most common error.