Xiangqi

Xiangqi (Chinese:, p Xiàngqí), also called Chinese chess, is a strategy board game for two players. It is one of the most popular board games in China, and is in the same family as Western (or international) chess, chaturanga, shogi, Indian chess and janggi. Besides China and areas with significant ethnic Chinese communities, xiangqi (cờ tướng) is also a popular pastime in Vietnam.

The game represents a battle between two armies, with the object of capturing the enemy's general (king). Distinctive features of xiangqi include the cannon (pao), which must jump to capture; a rule prohibiting the generals from facing each other directly; areas on the board called the river and palace, which restrict the movement of some pieces (but enhance that of others); and placement of the pieces on the intersections of the board lines, rather than within the squares.

Board
Xiangqi is played on a board that is nine lines wide and ten lines long. In a manner similar to the game Go (Wéiqí 圍棋), the pieces are played on the intersections, which are known as points. The vertical lines are known as files, while the horizontal lines are known as ranks.

Centered at the first through third and eighth through tenth ranks of the board are two square zones. The three point by three point zone is demarcated by two diagonal lines connecting opposite corners and intersecting at the center point. Each of these areas is known as 宮, a "palace" or "fortress".

Dividing the two opposing sides, between the fifth and sixth ranks, is 河 hé, the "river". The river is often marked with the phrases 楚河, meaning "Chu River", and 漢界 (in Traditional Chinese), , meaning "Han border", a reference to the Chu-Han War. Although the river provides a visual division between the two sides, only two pieces are affected by its presence: soldier pieces have an enhanced move after crossing the river, while elephant pieces cannot cross. The starting points of the soldiers and cannons are usually, but not always, marked with small crosses.

Rules


The pieces start in the position shown in the diagram above. Which player moves first has varied throughout history and from one part of China to another. Different xiangqi books advise either that the black or red side moves first. Some books refer to the two sides as north and south; which direction corresponds to which color also varies from source to source. Generally, Red moves first in most modern tournaments.

Each player in turn moves one piece from the point it occupies to another point. Pieces are generally not permitted to move through a point occupied by another piece. A piece can be moved onto a point occupied by an enemy piece, in which case the enemy piece is captured and removed from the board. A player cannot capture one of his own pieces. Pieces are never promoted (converted into other pieces), although the soldier is able to move sideways after it crosses the river. Almost all pieces capture using their normal moves, while the cannon has a special capture move described below.



The game ends when one player captures the other's general. When the general is in danger of being captured by the enemy player on his next move, the enemy player has "delivered a check" (, abbreviated ), and the general is "in check". A check should be announced. If the general's player can make no move to prevent the general's capture, the situation is called "checkmate". Unlike chess, in which a stalemate is a draw, in xiangqi, a player with no legal moves left loses.

In xiangqi, a player—often with material or positional disadvantage—may attempt to check or chase pieces in a way such that the moves fall in a cycle, forcing the opponent to draw the game. The following special rules are used to make it harder to draw the game by endless checking and chasing, regardless of whether the positions of the pieces are repeated or not:
 * The side that perpetually checks with one piece or several pieces can be ruled to have lost unless he or she stops such checking.
 * The side that perpetually chases any one unprotected piece with one or more pieces, excluding generals and soldiers, will be ruled to have lost unless he or she stops such chasing.
 * If one side perpetually checks and the other side perpetually chases, the checking side has to stop or be ruled to have lost.
 * When neither side violates the rules and both persist in not making an alternate move, the game can be ruled as a draw.
 * When both sides violate the same rule at the same time and both persist in not making an alternate move, the game can be ruled as a draw.

Different sets of rules set different limits on what is considered perpetual. For example, club xiangqi rules allow a player to check or chase six consecutive times using one piece, twelve times using two pieces, and eighteen times using three pieces before considering the action perpetual.

The above rules to prevent perpetual checking and chasing, while popular, are not the only ones; there are numerous end game situations.

Pieces
The two players' pieces are usually colored red and black. Pieces are flat circular disks labeled or engraved with a Chinese character identifying the piece type, and in a color indicating which player has ownership. The black pieces are marked with somewhat different characters from the corresponding red pieces.

In mainland China, most sets still use traditional Chinese characters (as opposed to simplified Chinese characters). Modern pieces are usually plastic, though some sets are wooden, and more expensive sets may use jade. In more ancient times, many sets were simple unpainted woodcarvings; thus, to distinguish between pieces of the two sides, most corresponding pieces used characters that were similar but varied slightly. This practice may have originated in situations where there was only one material available to make the pieces from and no coloring material available to distinguish the opposing armies. The oldest xiangqi piece found to date is a 俥 (chariot) piece. It is kept in the Henan Provincial Museum.

General
Generals are labelled with the Chinese character 將 (trad.) / 将 (simp.) ("general") on the black side and 帥 (trad.) / 帅 (simp.)  ("marshal") on the red side.

The general starts the game at the midpoint of the back edge, within the palace. The general may move and capture one point orthogonally. The two generals may not face each other in the same file with no intervening pieces.

If that happens, the 飛將 ("flying general") move may be executed, in which one general may cross the board to capture the enemy general. In practice, this rule is only used to enforce checkmate. The general may not leave the palace except when executing the flying general move.

The Indian name king for this piece was changed to general because China's rulers objected to their royal titles being given to game pieces.

Advisor
Advisors (also known as guards or ministers, and less commonly as assistants, mandarins, or warriors) are labelled 士 ("scholar", "gentleman", "officer") for Black and 仕  ("scholar", "official") for Red. Rarely, sets use the character 士 for both colors.

The advisors start on either side of the general. They move and capture one point diagonally and may not leave the palace, which confines them to five points on the board. The advisor is probably derived from the mantri in chaturanga, like the queen in Western chess.

Elephant
Elephants are labeled 象 xiàng ("elephant") for Black and 相 xiàng ("minister") for Red. They are located next to the advisors. These pieces move and capture exactly two points diagonally and may not jump over intervening pieces; the move is described as being like the character 田 Tián ("field"). If an elephant cannot move due to a diagonally adjacent piece, it is known as "blocking the elephant's eye" (塞象眼).

Elephants may not cross the river, and serve as defensive pieces. Because an elephant's movement is restricted to just seven board positions, it can be easily trapped or threatened. The two elephants are often used to defend each other.

The Chinese characters for "minister" and "elephant" are homophones in Mandarin and both have alternative meanings as "appearance" or "image". However, both are referred to as elephants in the game.

Horse


Horses are labelled 馬 for Black and 傌  for Red in sets marked with Traditional Chinese characters and 马 mǎ for both Black and Red in sets marked with Simplified Chinese characters. Some traditional sets use 馬 for both colors. Horses begin the game next to the elephants, on their outside flanks. A horse moves and captures one point orthogonally and then one point diagonally away from its former position, a move which is traditionally described as being like the character 日 Rì. The horse does not jump as the knight does in Western chess, and can be blocked by a piece located one point horizontally or vertically adjacent to it. Blocking a horse is called "hobbling the horse's leg" (蹩馬腿). The diagram on the left illustrates the horse's movement.

Since horses can be blocked, it is sometimes possible to trap the opponent's horse. It is possible for one player's horse to have an asymmetric attack advantage if an opponent's horse is blocked, as seen in the diagram on the right.

Chariot
Chariots are labelled 車 for Black and 俥 for Red in sets marked with Traditional Chinese characters and 车 for both Black and Red in sets marked with Simplified Chinese characters. Some traditional sets use 車 for both colors. All of these characters are pronounced as. The chariot moves and captures any distance orthogonally, but may not jump over intervening pieces. The chariots begin the game on the points at the corners of the board. The chariot is often considered to be the strongest piece in the game due to its freedom of movement and lack of restrictions.

The chariot is sometimes known as the rook by English-speaking players, since it is like the rook in Western chess. Chinese players (and others) often call this piece a car, since that is one modern meaning of the character 車.

Cannon
Cannons are labelled 砲 ("catapult") for Black and 炮 pào ("cannon") for Red. The names are homophones, though sometimes 炮 is used for both Red and Black. The 石 shí radical of 砲 means "stone", and the 火 huǒ radical of 炮 means "fire". Both colors' pieces are normally referred to as cannons in English. The black piece is sometimes labelled 包.

Each player has two cannons, which start on the row behind the soldiers, two points in front of the horses. Cannons move like chariots, any distance orthogonally without jumping, but can only capture by jumping a single piece, friend or foe, along the path of attack. The piece over which the cannon jumps is called the 炮臺 (trad.) / 炮台 (simp.) pào tái ("cannon platform") or "screen". Any number of unoccupied spaces, including none, may exist between the cannon, screen, and the piece to be captured. Cannons can be exchanged for horses immediately from their starting positions.

Soldier
Each side has five soldiers, labelled 卒 ("pawn" or "private") for Black and 兵  ("soldier") for Red. Soldiers begin the game located on every other point one row back from the edge of the river. They move and capture by advancing one point. Once they have crossed the river, they may also move and capture one point horizontally. Soldiers cannot move backward, and therefore cannot retreat; after advancing to the last rank of the board, however, a soldier may still move sideways at the enemy's edge. The soldier is sometimes called the "pawn" by English-speaking players, due to the pieces' similarities.

Approximate relative values of the pieces
These approximate values do not take into account the position of the piece in question (except the soldier in a general sense), the positions of other pieces on the board, or the number of pieces remaining.

Notation
There are several types of notation used to record xiangqi games. In each case the moves are numbered and written with the same general pattern.


 * 1) (first move) (first response)
 * 2) (second move) (second response)

It is clearer but not required to write each move pair on a separate line.

System 1
The book The Chess of China describes a move notation method in which the ranks of the board are numbered 1 to 10 from closest to farthest away, followed by a digit 1 to 9 for files from right to left. Both values are relative to the moving player. Moves are then indicated as follows:

Thus, the most common opening in the game would be written as:


 * 1) 炮 (32)–35  馬 (18)–37

System 2
A notation system partially described in A Manual of Chinese Chess and used by several computer software implementations describes moves in relative terms as follows:

The file numbers are counted from each player's right to each player's left.

In case there are two identical pieces in one file, symbols + (front) and – (rear) are used instead of former file number. Direction of movement is indicated via an operator symbol. A plus sign is used to indicate forward movement. A minus sign is used to indicate backwards movement. A dot or period or equal sign is used to indicate horizontal or lateral movement. For a piece that moves diagonally (such as the horse or elephant), the plus or minus sign is used rather than the period.

Thus, the most common opening in the game would be written as:


 * 1) C2.5 H8+7

System 3
This system is unofficial and principally used by Western players. It is similar to algebraic notation for Western chess. Letters are used for files and numbers for ranks. File "a" is on Red's left and rank "1" is nearest to Red. A point's designation does not depend on which player moves; for both sides "a1" is the lowest left point from Red's side.

Pieces are abbreviated as in notation system 2, except that no letter is used for the soldier.

Former position is only indicated if necessary to distinguish between two identical pieces that could have made the move. If they share the same file, indicate which rank moves; if they share the same rank, indicate which file moves. If they share neither rank nor file, then the file is indicated.

Capture is indicated by "x". No symbol is used to indicate a non-capturing move.

Check is indicated by "+", double check by "++", triple check by "+++", and quadruple check by "++++". Checkmate is indicated by "#".

For analysis purposes, bad moves are indicated by "?" and good moves by "!". These can be combined if the analysis is uncertain ("!?" might be either but is probably good; "?!" is probably bad) or repeated for emphasis ("??" is a disaster).

Thus, the most common opening in the game would be written as:


 * 1) Che3 Hg8

An example of a brief game ("the early checkmate") is:

Gameplay
Because of the size of the board and the low number of long-range pieces, there is a tendency for the battle to focus on a particular area of the board.

Tactics
Xiangqi involves several tactics common to games in the chess family. Some common ones are briefly discussed here.


 * When one piece can attack more than one enemy piece, they are forked.


 * A piece is pinned when it cannot move without exposing a more important piece to capture. Cannons can pin two pieces at once on one file or rank, horses can pin because they can be blocked, and generals can pin because of the "flying general" rule.


 * A piece is skewered when it is attacked and, by moving, exposes a less important piece to be captured.


 * A discovered check occurs when an attacking piece moves so that it unblocks a line for a chariot, cannon, and less often, the horse, to check the enemy general. The piece uncovering the check can safely move anywhere within its powers regardless of whether the opponent has those squares under protection.


 * A double check occurs when two pieces simultaneously threaten the enemy general. It may or may not be possible to block, but capturing one of the checking pieces is insufficient to remove the threat. The only blockable cases are either a chariot and cannon on the same file as the general, with the chariot acting as a screen for the cannon, or two horses giving discovered check after another piece unblocks the attack from both. Other combinations of double checks are not blockable.


 * Unique to xiangqi is a triple check, which arises in two combinations. In the first case of a cannon, a chariot or soldier, and a horse, the horse moves to give check, uncovering a double check from the chariot and the cannon. In the second, rarer case of a chariot or soldier and two horses, the chariot moves to give check, uncovering a double check from the two horses. Quadruple check is also possible, arising with two horses, a chariot, and a cannon. Triple and quadruple check cannot be blocked.

Usually, soldiers do not support each other, because from the initial position it takes a minimum of five moves of a soldier to allow mutual protection between two of them.

The chariots, as the most valuable pieces, are not normally lined up together, as it risks losing one chariot to an enemy's inferior piece. Depending on the situation, it may be advantageous to position a chariot at one of the corners on the enemy's side of the board, where it is difficult to dislodge and able to threaten the enemy general.

It is common to use cannons independently to control particular ranks and files. Using a cannon to control the middle file is often considered vital strategy, because it locks pieces such as the advisors and elephants in certain positions to prevent a check. The two files adjacent to the middle file are also considered important and horses and chariots can be used to push for checkmate there. Two cannons on the same file is also a powerful formation, as the rear cannon can threaten the general, but moving a piece in front of the cannons to block will fail, because the front cannon can then attack the general.

A common defensive configuration is to leave the general at its starting position, deploy one advisor and one elephant on the two points directly in front of the general, and to leave the other advisor and elephant in their starting positions, to the side of the general. In this setup, the advisor-elephant pairs support each other, and the general is immune from attacks by cannons. Losing any of the pieces makes the general vulnerable to cannon, and the setup may need to be abandoned. The defender may move advisors or elephants away from the general, or even sacrifice them intentionally, to ward off attack by a cannon.

Openings
Since the left and right flanks of the starting setup are symmetrical, it is customary to make the first move on the right flank. Starting on the left flank is considered needlessly confusing.

The most common opening is to move the cannon to the central column, an opening known as 當頭炮 (trad.) / 当头炮 (simp.) dāng tóu pào ("appropriate start cannon"). The most common reply is to advance the horse on the same flank. Together, this move-and-response is known by the rhyme 當頭炮，馬來跳 (trad.) / 当头炮，马来跳 (simp.). The notation for this is "1. 炮 (32)–35, 馬 (18)–37", "1. C2.5 H8+7", or "1. Che3 Hg8" (diagram at right).

The most common second move is 出車 (trad.) / 出车 (simp.) chū jū ("chariot sortie"), in which the first player moves a chariot forward one space. The most common reply is to move the right advisor diagonally, 上士 shàng shì. This prevents a series of events that leads to the first player quickly checkmating the second.

Less common first moves include moving an elephant to the central column, advancing the soldier on the third or seventh file, moving a horse forward, and moving either cannon behind the second soldier from the left or right.

General advice for the opening includes rapid development of at least one chariot, as it is the most powerful piece with a long attack range. There is a saying that only a poor player does not move a chariot in the first three moves. Another possible start is to develop one horse to the edge of the board to avoid being blocked by one's own unmovable soldiers. Usually, at least one horse should be moved to the middle.

History
The commonly accepted theory, developed by Harold James Ruthven Murray, author of A History of Chess, is that games from the chess family originated in India. From there, they spread to the rest of the world, and one offshoot evolved into modern xiangqi in China, possibly influenced by other games already played there.

References to a game called xiangqi date back to the Warring States period; according to the first century BC text Shuo yuan (說苑), it was one of Lord Mengchang of Qi's interests. Emperor Wu of Northern Zhou wrote a book in AD 569 called Xiang Jing. It is believed to have described the rules of an astronomically themed game called xiangqi or xiangxi (象戲). The word xiàngqí 象棋 is usually translated as "elephant game" or "figure game", because the Chinese character 象 means "elephant" and "figure"; it originated as a stylized drawing of an elephant, and was used to write a word meaning "figure", likely because the two words were pronounced the same. But the name can also mean "constellation game", and sometimes the xiàngqí board's "river" is called the "heavenly river", which may mean the Milky Way.

For these reasons, Murray theorized that "in China [chess] took over the board and name of a game called 象棋 in the sense of 'Astronomical Game', which represented the apparent movements of naked-eye-visible astronomical objects in the night sky, and that the earliest Chinese references to 象棋 meant the Astronomical Game and not Chinese chess". Previous games called xiàngqí may have been based on the movements of sky objects. However, the connection between 象 and astronomy is marginal, and arose from constellations being called "figures" in astronomical contexts where other meanings of "figure" were less likely; this usage may have led some ancient Chinese authors to theorize that the game 象棋 started as a simulation of astronomy.

To support his argument, Murray quoted an old Chinese source that says that in the older xiangqi (which modern xiangqi may have taken some of its rules from) the game pieces could be shuffled, which does not happen in the modern chess-style xiangqi. Murray also wrote that in ancient China there was more than one game called xiangqi.

An alternative hypothesis to Murray's is that xiangqi was patterned after the array of troops in the Warring States era. David H. Li, for example, argues that the game was developed by Han Xin in the winter of 204 BC-203 BC to prepare for an upcoming battle. His theories have been questioned by other chess researchers, however. The earliest description of the game's rules appears in the story "Cen Shun" (岑順) in the collection Xuanguai lu (玄怪錄), written in the middle part of the Tang dynasty.

With the economic and cultural development during the Qing Dynasty, xiangqi entered a new stage. Many different schools of circles and players came into prominence. With the popularization of xiangqi, many books and manuals on the techniques of playing the game were published. They played an important role in popularizing xiangqi and improving the techniques of play in modern times. A Western-style Encyclopedia of Chinese Chess Openings was written in 2004.

Tournaments and leagues
Although xiangqi has its origin in Asia, there are xiangqi leagues and clubs all over the world. Each European nation generally has its own governing league; for example, in Britain, xiangqi is regulated by the United Kingdom Chinese Chess Association. Asian countries also have nationwide leagues, such as the Malaysia Chinese Chess Association.

In addition, there are several international federations and tournaments. The Chinese Xiangqi Association hosts several tournaments every year, including the Yin Li and Ram Cup Tournaments. Other organizations include the Asian Xiangqi Federation and a World Xiangqi Federation, which hosts tournaments and competitions bi-annually, with most limited to players from member nations.

Rankings
The Asian Xiangqi Federation (AXF) and its corresponding member associations rank players in a format similar to the Elo rating system of chess. According to the XiangQi DataBase, the top-ranking female and male players in China, as of June 2012, were Tang Dan and Jiang Chuan, with ratings of 2529 and 2667, respectively. Other strong players include Zhao GuanFang (female), Xu Yinchuan (male), Lu Qin (male), and Wang LinNa (female).

The Asian Xiangqi Federation also bestows the title of grandmaster to select individuals around the world who have excelled at xiangqi or made special contributions to the game. There are no specific criteria for becoming a grandmaster and the list of grandmasters was fewer than a hundred people in September 1996. The titles of grandmaster is bestowed by bodies such as the AXF and the Chinese Xiangqi Association (CXA).

Computers
The game-tree complexity of xiangqi is approximately 10150; in 2004 it was projected that a human top player will be defeated before 2010. Xiangqi is one of the more popular competitions at the annual Computer Olympiad.

Computer programs for playing xiangqi show the same development trend as has occurred for international chess: they are usually console applications (called engines) which communicate their moves in text form through some standard protocol. For displaying the board graphically, they then rely on a separate Graphical User Interface (GUI). Through such standardization, many different engines can be used through the same GUI, which can also be used for automated play of different engines against each other. Popular protocols are UCI (Universal Chess Interface), UCCI (Universal Chinese Chess Interface), Qianhong (QH) protocol, and WinBoard/XBoard (WB) protocol (the latter two named after the GUIs that implemented them). There now exist many dozens of xiangqi engines supporting one or more of these protocols, including some commercial engines.

Using a standard xiangqi board and pieces
Blitz Chess Each player only has around 5–10 minutes each, depending on the exact rules.

Supply Chess Similar to the Western chess variant Bughouse Chess, this variant features the ability to re-deploy captured pieces, similar to a rule in shogi. Four players play as two-person teams in two side-by-side games. One teammate plays Black and other plays Red. Any piece obtained by capturing the opponent's piece is given to the teammate for use in the other game. These pieces can be deployed by the teammate to give him an advantage over the other player, so long as the piece starts on the player's own side of the board and does not cause the opponent to be in check.

Formation One player's pieces are jumbled up, then placed randomly on one side of the river, except for the generals and advisors, which must be at their usual positions, and the elephants, which must start at two of the seven points they can normally reach. The other player's pieces are set up to mirror the first's. All other rules are the same.

Banqi This variation is more well known in Hong Kong than in mainland China. It uses the xiangqi pieces and board, but does not follow any of its rules, bearing more of a resemblance to the western game Stratego as well as the Chinese game Luzhanqi.

Using a special board and/or pieces
There are many versions of three-player xiangqi, or san xiangqui, all played on special boards.

San Guo Qi "Game of the Three Kingdoms" is played on a special hexagonal board with three xiangqi armies (red, blue, and green) vying for dominance. A Y-shaped river divides the board into three gem-shaped territories, each containing the grid found on one side of a xiangqi board, but distorted to make the game playable by three people. Each player has eighteen pieces: the sixteen of regular xiangqi, plus two new ones that stand on the same rank as the cannons. The new pieces have different names depending on their side: huo ("fire") for Red, qi ("flag") for Blue, and feng ("wind") for Green. They move two spaces orthogonally, then one space diagonally. The generals each bear the name of a historical Chinese kingdom—Shu for Red, Wei for Blue, and Wu for Green—from China's Three Kingdoms period. It is likely that San Guo Qi first appeared under the Southern Song Dynasty (960–1279).

San You Qi "Three Friends Chess" was invented by Zheng Jinde from Shexian in the Anhui province during the reign of the Kangxi Emperor of Qing Dynasty (1661–1722). It is played on a Y-shaped board with a full army of xiangqi pieces set up at the end of each of the board's three wide radii. In the center of the board sits a triangular zone with certain features, such as ocean, mountain, or city walls, each of which is impassable by certain pieces. Two of an army's five soldiers are replaced by new pieces called huo ("fire") pieces, which move one space diagonally forward. Two qi ("flag") pieces are positioned on the front corners of the palace; they move two spaces forward inside their own camp, and then one space in any direction inside an enemy camp.

Sanrenqi "Three Men Chess" is a riverless, commercial variant played on a cross-shaped board with some special rules, including a fourth, neutral country called Han. Han has three Chariots, one Cannon, and one General named "Emperor Xian of Han", but these pieces do not move and do not belong to any of the players until a certain point in the game when two players team up against the third player. At that point the third player gets to also control Han.

Si Guo Qi "Four Kingdoms Chess" is also played on a riverless, cross-shaped board, but with four players. Because there are no rivers, elephants may move about the board freely.