This commit is contained in:
Miloslav Ciz 2025-03-26 21:33:03 +01:00
parent 21973f4724
commit a8a9ce5cfc
22 changed files with 2026 additions and 1983 deletions

View file

@ -1,6 +1,6 @@
# Chess
Chess (from Persian *shah*, *king*) is a very [old](old.md) two-player board [game](game.md), perhaps most famous and popular among all board games in [history](history.md). In video game terms we could call it a turn-based strategy, in [mathematical](math.md) terms it's a [zero sum](zero_sum.md), [complete information](complete_information.md) game with no element of [randomness](randomness.md), that simulates a battle of two armies on an 8x8 board with different battle pieces, also called *chessmen* or just *men* (also [stones](rock.md), pieces or juicers). Chess is also called the King's Game, it has a worldwide [competitive](competition.md) community and is considered an intellectual [sport](sport.md) but it's also been a topic of research and [programming](programming.md) (many chess engines, [AI](ai.md)s and frontends are being actively developed). Chess is similar to games such as [shogi](shogi.md) ("Japanese chess"), [xiangqi](xiangqi.md) ("Chinese chess") and [checkers](checkers.md). As the estimated number of chess games is bigger than [googol](googol.md), it is unlikely to ever get solved; though the complexity of the game in sheer number of possibilities is astronomical, among its shogi, go and xiangqi cousins chess is actually considered one of the "simplest" (the board is relatively small and the game tends to simplify as it goes on as there are no rules to get men back to the game etc.).
Chess (from Persian *shah*, *king*) is a remarkable, very [old](old.md) two-player board [game](game.md), perhaps most famous and popular among all board games in [history](history.md). In video game terms we might sort it into the turn-based strategy genre, in [mathematical](math.md) terms it's a [zero sum](zero_sum.md), [complete information](complete_information.md) game with no element of [randomness](randomness.md), that simulates a battle of two armies on an 8x8 board with different battle pieces, also called *chessmen* or just *men* (also [stones](rock.md), pieces or juicers). Chess is also called the King's Game, it has a worldwide [competitive](competition.md) community and is considered an intellectual [sport](sport.md) but it's also been a topic of research and [programming](programming.md) (many chess engines, [AI](ai.md)s and frontends are being actively developed). Chess is similar to games such as [shogi](shogi.md) ("Japanese chess"), [xiangqi](xiangqi.md) ("Chinese chess") and [checkers](checkers.md). As the estimated number of chess games is bigger than [googol](googol.md), it is unlikely to ever get solved; though the complexity of the game in sheer number of possibilities is astronomical, among its shogi, go and xiangqi cousins chess is actually considered one of the "simplest" (the board is relatively small and the game tends to simplify as it goes on as there are no rules to get men back to the game etc.).
{ There is a nice black and white indie movie called *Computer Chess* about chess programmers of the 1980s, it's pretty good, very oldschool, starring real programmers and chess players, check it out. ~drummyfish }
@ -39,8 +39,8 @@ Chess evolved from ancient board games in India (most notably Chaturanga) in abo
The mastery of chess is often divided into two main areas (it is also common to divide strong players into these two categories depending on where their main strength lies):
- **positional play**: Long term, big picture patterns that offer many advantages and opportunities for playing good moves, trying to get a "good position" with men on strong squares, controlling key parts of the board, putting pressure on enemy, ensuring safety of own king etc.
- **tactical play**: Short term, quick action, tricks and calculation skills that win advantages, often material, with tools like forks, pins, discovery checks, sacrifices etc.
- **positional play**: Strategic, long term, big picture patterns leading to general advantages and opportunities and easy choices of good moves, trying to get a "good position" with men on strong squares, guarding each other, controlling key parts of the board, putting enemy under pressure, taking away his maneuvering space, ensuring safety of own king, good pawn structure, leading pawns close to promotion etc.
- **tactical play**: Short term, quick action, tricks and calculation skills that win advantages, often material, with tools such as forks, pins, discovery checks, double attacks, sacrifices, zugzwangs etc.
Of course this is not the only possible division, another one may be for example offensive vs defensive play etc., but generally chess revolves around position and tactics.
@ -72,9 +72,9 @@ Fun fact: there seem to be **almost no black people in [chess](chess.md)** :D th
[Computers](computer.md) not only help people play chess, train their skills, analyze positions and perform research of games, but they also allow mathematical analysis of the game of chess itself and present a platform for things such as [artificial intelligence](ai.md). Knowledge gained from programming chess engines can then be applied in other areas as well. Since the dawn of the computer era computer chess has been a topic of passion and interest to [computer scientists](compsci.md) and [programmers](programming.md) -- not just because nerds usually love both chess and computer and it's only natural they will desire to combine the two, and not only because making a machine beat human at the most famous and iconic of all intellectual games is just a great and symbolic achievement in itself, but also because computer chess is just so much [fun](fun.md). For example you may let various engines play against each other, just sit back and make your own mini computer engine tournament, compare the strength of your engines, let them play from funny starting positions, let a strong engine with material handicap play a weak engine, program a strong engine to play the worst moves possible or program it completely arbitrary or weird goals such as that it can only checkmate with a pawn or that it will just want to place all its pieces on white squares, and then watch it try hard to achieve the goal. It's endless joy.
**Chess [software](software.md)** is usually separated to **[libraries](library.md)**, **chess engines** and **[frontends](frontend.md)**. Library is just that -- a programming library that will help a programmer create some kind of chess program. Chess engine on the other hand is a complete program whose main purpose is to compute good chess moves, it is typically a [CLI](cli.md) program capable of playing chess but also doing other things such as evaluating arbitrary positions, hinting best moves, saving and loading games etc. -- commonly the engine has some kind of custom CLI interface (flags, interactive commands it understands, ...) plus a support of some standardized text communication protocol, most notably XBoard (older one, more [KISS](kiss.md)) and/or UCI (newer, more [bloated](bloat.md)). It is also a must for an engine to support other standard formats such as **FEN** (ForsythEdwards notation, way of encoding a chess position as a text string), **PGN** (portable game notation, way of encoding games as text strings) etc. And then there are frontends (also called *boards*) -- these are, almost by definition, [GUI](gui.md) programs that help people interact with the underlying engine (and do other things like play against other humans, annotate games and so on). There may also exist other kind of programs, e.g. tournament managers that will automatically run a tournament of several chess engines, calculate their strength etc. As seen, the chess "ecosystem" is pretty modular (it is possible to easily drop-in replace any part of your chess system as they are all just black boxes with the same interface) and the whole system is based on standardized, relatively simple plain text protocols, i.e. this is all very close to [Unix philosophy](unix_philosophy.md) and [good design](lrs.md). This is an example of how games should be implemented.
**Chess [software](software.md)** is usually separated to **[libraries](library.md)**, **chess engines** and **[frontends](frontend.md)**. Library is just that -- a programming library that will help a programmer create some kind of chess program. Chess engine on the other hand is a complete program whose main purpose is to compute good chess moves, it is typically a [CLI](cli.md) program capable of playing chess but also doing other things such as evaluating arbitrary positions, hinting best moves, saving and loading games etc. -- commonly the engine has some kind of custom CLI interface (flags, interactive commands it understands, ...) plus a support of some standardized text communication protocol, most notably XBoard (older one, more [KISS](kiss.md)) and/or UCI (newer, more [bloated](bloat.md)). It is also a must for an engine to support other standard formats such as **FEN** (ForsythEdwards notation, way of encoding a chess position as a text string), **PGN** (portable game notation, way of encoding games as text strings) etc. And then there are frontends (also called *boards*) -- these are, almost by definition, [GUI](gui.md) programs that help mere mortal people interact with the underlying engine (and do other things like play against other humans, annotate games and so on). There also exist other kinds of programs, e.g. tournament managers that automatically run a tournament of several chess engines, calculate their strength etc. As seen, the chess "ecosystem" exemplifies a textbook modularity (it is possible to easily drop-in replace any part of your chess system as they are all just black boxes with the same interface) and the whole system stands on a solid, standardized, relatively simple plain text protocols, giving a shining example of [Unix philosophy](unix_philosophy.md) and [good design](lrs.md) in practice. In an [ideal world](less_retarded_society.md) all games would be implemented this way.
Computers have already surpassed the best humans in their playing strength (we can't exactly compute an engine's [Elo](elo.md) as it depends on hardware used, but generally the strongest would rate high above 3000 FIDE). As of 2023 the strongest chess engine is widely agreed to be the [FOSS](foss.md) engine **[Stockfish](stockfish.md)**, with other strong engines being e.g. Leela Chess Zero (also FOSS), AlphaZero ([proprietary](proprietary.md) by [Google](google.md)) or Komodo Dragon (proprietary). [GNU Chess](gnu_chess.md) is a pretty strong [free software](free_software.md) engine by [GNU](gnu.md). There are world championships for chess engines such as the *Top Chess Engine Championship* or *World Computer Chess Championship*. [CCRL](https://ccrl.chessdom.com/ccrl/4040/) is a list of chess engines along with their Elo ratings deduced from tournaments they run. Despite the immense strength of modern engines, there are still some specific artificial situations in which a human beats the computer (shown e.g. in [this](https://www.youtube.com/watch?v=R9IZWgArWUE) video); this probably won't last long though.
Computers have already surpassed the best humans in their playing strength (we can't exactly assign [Elo](elo.md) rating to an engine alone, as hardware it runs on plays a vital role, but as a general statement it's nowadays easy for anyone to carry around a pocket chess computer rated high above 3000 FIDE, i.e. capable of easily shattering even the world champion). As of 2023 the strongest chess engine is undoubtedly the [FOSS](foss.md) engine **[Stockfish](stockfish.md)**, with other strong ones being e.g. Leela Chess Zero (also FOSS), AlphaZero ([proprietary](proprietary.md) by [Google](google.md)) or Komodo Dragon (proprietary). [GNU Chess](gnu_chess.md) is a fairly strong [free software](free_software.md) engine by [GNU](gnu.md). There are world championships for chess engines such as the *Top Chess Engine Championship* or *World Computer Chess Championship*. [CCRL](https://ccrl.chessdom.com/ccrl/4040/) is a list of chess engines along with their Elo ratings deduced from tournaments they run. Despite the immense strength of modern engines, there are still some specific artificial situations in which a human beats the computer (shown e.g. in [this](https://www.youtube.com/watch?v=R9IZWgArWUE) video); this probably won't last long though.
The first chess computer that beat the world champion (at the time Gary Kasparov) was famously [Deep Blue](deep_blue.md) in 1997. [Alan Turing](turing.md) himself has written a chess playing [algorithm](algorithm.md) but at his time there were no computers to run it, so he executed it by hand -- nowadays the algorithm has been implemented on computers (there are bots playing this algorithm e.g. on lichess).