X-Wing
Learn it here, then practice it in Sudoku by DvalinIts hints keep teaching as you play: where to look, which technique to use, and why it works.In short: when a number can go in only two cells in each of two rows, and those four cells line up in the same two columns, the number must land on opposite corners of that rectangle. That means it can't go anywhere else in those two columns.
- When you need it
- The pattern
- Why it works
- A worked example
- How to spot one
- Common mistakes
- Related techniques
When you need it
Most puzzles at the easier levels can be finished with singles alone. In harder puzzles you reach a point where every number has at least two possible places, no cell is down to one number, and pairs and pointing don't move anything either. X-Wing is often the first technique that breaks that kind of logjam. It never fills in a number by itself. Instead, it removes a number from your notesNotes The small numbers in an empty cell showing what could still go there. Also called candidates or pencil marks., and that removal usually opens up a single somewhere nearby.
Because X-Wing works entirely with notesNotes The small numbers in an empty cell showing what could still go there. Also called candidates or pencil marks., it only works if your notesNotes The small numbers in an empty cell showing what could still go there. Also called candidates or pencil marks. are complete and correct. If you've been filling in notesNotes The small numbers in an empty cell showing what could still go there. Also called candidates or pencil marks. by hand, take a moment to check them before you go looking for one.
The pattern
Pick one number. Look for two rows where that number has exactly two possible cells. If those two pairs of cells sit in the same two columns, the four cells form the corners of a rectangle. That rectangle is the X-Wing.
The same pattern works with rows and columns swapped: two columns where a number has exactly two spots each, lined up in the same two rows. The logic and the result are the same, just turned on its side.
Why it works
Every row needs the number once. The top row of the rectangle can only put it in its left corner or its right corner, and the same goes for the bottom row. That leaves just two possibilities:
- Top-left and bottom-right, or
- Top-right and bottom-left.
It can't be top-left and bottom-left, because the two would share a column. Whichever way it falls, the number ends up once in the left column and once in the right column, both times inside the rectangle. Each column needs the number only once, so no other cell in those two columns can hold it. You can remove it from their notesNotes The small numbers in an empty cell showing what could still go there. Also called candidates or pencil marks., even though you don't yet know which diagonal is the right one.
A worked example
This is the board from the X-Wing lesson in Sudoku by Dvalin, with all of the notesNotes The small numbers in an empty cell showing what could still go there. Also called candidates or pencil marks. filled in. Blue numbers have been placed by the player. Black numbers were given at the start.
Row 4 has to put its 2 in column 3 or column 6. So does row 8. Whichever way it works out, columns 3 and 6 each get their 2 from rows 4 and 8.
With those 2s gone, look at the cells they came from. The cell in row 7, column 6 had only 2 and 7 left, so now it must be 7, and the puzzle moves again. That's typical: the X-Wing itself only removes notesNotes The small numbers in an empty cell showing what could still go there. Also called candidates or pencil marks., and the payoff is the single it uncovers.
How to spot one
- Go one number at a time. X-Wings are about a single number, so scan for 1s, then 2s, and so on, rather than looking at the whole board at once.
- Find rows with exactly two spots. For the number you're checking, note every row where it has only two possible cells. Skip rows where it's already placed.
- Compare their columns. If two of those rows use the same pair of columns, you've found an X-Wing.
- Check that it does something. Look up and down the two columns. If the number appears in the notesNotes The small numbers in an empty cell showing what could still go there. Also called candidates or pencil marks. of any other cell there, those notesNotes The small numbers in an empty cell showing what could still go there. Also called candidates or pencil marks. can go. If not, the X-Wing is real but doesn't help yet.
- Then turn it sideways. Repeat with columns that have exactly two spots, and compare their rows.
Numbers that have already been placed six or seven times are good places to start. With only a few copies left to place, they're more likely to be down to two spots in several rows.
Common mistakes
- Removing from the wrong lines. The eliminations happen in the two columns when you found the pattern in rows, and in the two rows when you found it in columns. The two lines you started from are never where you remove anything.
- A row with three spots. Both rows must have exactly two spots for the number. If one row has three, it isn't an X-Wing. It may be part of a Swordfish instead.
- Corners that don't line up. If one row uses columns 3 and 6 and the other uses columns 3 and 7, there's no rectangle. That shape is closer to a Skyscraper.
- Trusting incomplete notesNotes The small numbers in an empty cell showing what could still go there. Also called candidates or pencil marks.. If a note is missing, a row can look like it has two spots when it really has three. Make sure every empty cell's notesNotes The small numbers in an empty cell showing what could still go there. Also called candidates or pencil marks. are complete before relying on an X-Wing.
Related techniques
- Swordfish is the same idea with three rows and three columns, and Jellyfish with four.
- Skyscraper is what you get when only one side of the rectangle lines up.
- Pointing uses similar reasoning inside a single box.