# X-Wing (2x2 Fish)

## Difficulty

## Description

The X-Wing technique is best explained via example:

See how the **5** is restricted to exactly two cells within the marked row?

We do not know in which cell it will end up, but we know it will be in one of those two cells.

So far it does not help us much, but in combination with a row like this, which has its **5**s equally restricted, then we have found an X-Wing.

Where and what is the X-Wing exactly?

**This is the X-Wing**. It is the four **5**s.

Since in both rows the **5**s are restricted to only two cells, they can only be in one or the other.

This matrix-like configuration is essential for an X-Wing. The cells do not only interact row-wise, but also column-wise, because they are aligned both ways.

That results in them being not only mutually exclusive row-wise, but also column-wise.

Eventually the **5**s will be here...

... **or** here.

Either way, we know that a **5** can be nowhere else in those two columns, so we can eliminate them.

So this...

... becomes this.

## Summarized

So with an X-Wing, there are always two lines (in this case rows) in which a candidate is restricted to only two cells. Those two cells must also line up in the other direction (perpendicular, in this case columns)...

... and that tells us that the number cannot be in those perpendicular lines either.

## The other way around

This, of course, also works the other way around.

Here, the restriction is given via **columns**, and we can eliminate the candidate from the **rows**.

So generally:

- If a number is restricted within a
**column**, then an X-Wing allows us to eliminate from the**row**. - If a number is restricted within a
**row**, then an X-Wing allows us to eliminate from the**column**.

## X-Wing Examples

Here are a few examples found by the Solver.

The X-Wings the sudoku.coach Solver finds will always be spanning over four boxes. This is because if two cells would be in the same box, it would simply be Locked Candidate, which we would have already solved at that point.

## Not an X-Wing

An X-Wing that is completely contained within a single box can never exist, because then there would be two **5**s in the same box.