# Chess puzzle

A chess puzzle is a puzzle in which knowledge of the pieces and rules of chess is used to logically solve a chess-related problem. The history of chess puzzles reaches back to the Middle Ages and has since evolved.
Usually the goal is to find the single best, ideally aesthetic move or a series of single best moves in a chess position, that was created by a composer or is from a real game. But puzzles can also set different objectives. Examples include deducing the last move played, the location of a missing piece, or whether a player has lost the right to castle. Sometimes the objective is antithetical to normal chess, such as helping (or even compelling) the opponent to checkmate one's own king.

## Chess problems

While a chess puzzle is any puzzle involving aspects of chess, a chess problem (or chess composition) is a crafted position with a specified task to be fulfilled, such as White mates in n moves. Chess problems are divided into orthodox and heterodox types, both covering a variety of genres.
Orthodox problems employ the standard rules of chess and involve positions that can legally arise from actual gameplay. The most common form of orthodox problem is the directmate, which stipulates checkmate in n moves, usually two or three. The positions are often dissimilar to positions from actual play, sometimes to the extent of being outlandish in comparison. The key move is usually counter-intuitive. Despite their unusual stipulations, helpmates and selfmates are usually considered orthodox problems, as they use standard chess rules. Likewise, retrograde analysis problems are usually considered orthodox.
Heterodox problems, also called fairy chess problems, involve altered rules, such as different boards and pieces not used in standard chess.

## Tactical puzzles

Chess puzzles can also be regular positions from actual games, usually meant as tactical training positions. They can range from a simple "Mate in one" combination to a complex attack on the enemy king. Solving tactical chess puzzles is a very common chess teaching technique. They are helpful in pattern recognition.

### Example 1

The solution is 1...Qf2!, attacking the f1-rook; 2.Rxf2 would incur a back-rank checkmate after 2...Rd1+. If 2.Rg1, 2...Bc5 sets up a battery targetting g1, where White can stop checkmate only by moving the c1-bishop to connect rooks. Since the only two squares available to the bishop are controlled by the black queen, loss of the bishop is unavoidable. White's best try is 2.Be3, giving up the bishop immediately and leaving Black an easily won position.

### Example 2

The solution is 1.Ne6+!, unblocking White's h4-bishop and g1-rook. Black's f-pawn must guard the g6-bishop, preventing ...fxe6 in almost all variations; thus, if the black king moves after 1.Ne6+, then 2.Qxf6 leaves Black down a piece and in a mating net. 1...Kh7 and 2...Rhg8 defending the bishop allows for 3...fxe6, but White's attack is insurmountable, with prospects of opening the h-file with Bg5 and of Bxe6. White can force mate in less than 13 moves against any alternative to 1...Qxe6, which sacrifices material to blunt White's attack.

## Mathematical chess problems

Some chess problems, like the eight queens puzzle or the knight's tour problem, have connections to mathematics, especially to graph theory and combinatorics. Many famous mathematicians have studied such problems, including Euler, Legendre, and Gauss. Besides finding a solution to a particular puzzle, mathematicians are usually interested in counting the total number of possible solutions, finding solutions with certain properties, and generalization of the problems to n×n or rectangular boards.