Self chess in 1.0.1
each player begins the game with 16 pieces: one king, one queen, two rooks, two knights, two bishops, and eight pawns. each of the six piece types moves differently. the most powerful piece is the queen and the least powerful piece is the pawn. the objective is to ’checkmate’ the opponent’s king by placing it under an inescapable threat of capture. to this end, a player’s pieces are used to attack and capture the opponent’s pieces, while supporting their own. in addition to checkmate, the game can be won by voluntary resignation by the opponent, which typically occurs when too much material is lost, or if checkmate appears unavoidable. a game may also result in a draw in several ways, where neither player wins. the course of the game is divided into three phases: opening, middlegame, and endgamesince the second half of the 20th century, computers have been programmed to play chess with increasing success, to the point where the strongest home computers play chess at a higher level than the best human players. in the past two decades computer analysis has contributed significantly to chess theory, particularly in the endgame. the computer deep blue was the first machine to overcome a reigning world chess champion in a match when it defeated garry kasparov in 1997.games may be won in the following ways:checkmate
resignation – either player resign, conceding the game to the other player. it is usually considered poor etiquette to play on in a truly hopeless position, and for this reason high level games rarely end with a checkmate.
loss on time – in games with a time control, a player may also lose by running out of time, even with a much superior position.
forfeit – a player who cheats, or violates the laws of the game, or violates the rules specified for the particular tournament may be forfeited. in high level tournaments, players have been forfeited for such things as arriving late for the game (even by a matter of seconds), receiving a call or text on one’s cell phone, refusing to undergo a drug test, refusing to undergo a body search for electronic devices and unsporting behaviour (such as refusing to shake the opponent’s hand).
games may end in a draw in several ways:draw by agreement – draws are most commonly reached by mutual agreement between the players. the correct procedure is to verbally offer the draw, make a move, then start the opponent’s clock. traditionally players have been allowed to agree a draw at any time in the game, occasionally even without playing a move; in recent years efforts have been made to discourage short draws, for example by forbidding draw offers before move thirty.
stalemate – the player whose turn it is to move is not in check, but has no legal move.
threefold repetition of a position – this most commonly occurs when neither side is able to avoid repeating moves without incurring a disadvantage. the three occurrences of the position need not occur on consecutive moves for a claim to be valid. fide rules make no mention of perpetual check; this is merely a specific type of draw by threefold repetition.
the fifty-move rule – if during the previous 50 moves no pawn has been moved and no capture has been made, either player may claim a draw; this requires the players to keep a valid written record of the game so that the claim may be verified by the arbiter if challenged. there are in fact several known endgames where it is theoretically possible to force a mate but which require more than 50 moves before the pawn move or capture is made; examples include some endgames with two knights against a pawn and some pawnless endgames such as queen against two bishops. these endings are rare, however, and few players study them in detail, so the fifty-move rule is considered practical for over the board play. some correspondence chess organizations allow exceptions to the fifty-move rule.
insufficient material – a player may claim a draw if their opponent has insufficient material