This commit is contained in:
Miloslav Ciz 2024-10-16 20:58:06 +02:00
parent 7a2a69bd7b
commit fe2450711c
11 changed files with 1885 additions and 1860 deletions

View file

@ -44,7 +44,7 @@ A single game of chess is seen as consisting of three stages: **opening** (start
The study of chess openings is called **opening theory** or just *theory*. Playing the opening stage is special by being based on memorization of this theory, i.e. hundreds or even thousands of existing opening lines that have been studied and analyzed by computers, rather than by performing mental calculation (logical "thinking ahead" present in middlegame and endgame). Some see this as weakness of chess that makes players spend extreme energy on pure memorization. One of the best and most famous players, Bobby Fischer, was of this opinion and has created a chess variant with randomized starting position that prevents such memorization, so called *chess 960*.
**[Elo](elo.md) rating** is a mathematical system of numerically rating the performance of players (it is used in many sports, not just chess); Elo basically assigns players a rating number that says how skilled the player is. Given two players with Elo rating it is possible to compute the probability of the game's outcome (e.g. white has 70% chance of winning etc.). The FIDE set the parameters so that the rating is roughly this: < 1000: beginner, 1000-2000: intermediate, 2000-3000: master (currently best humans rate close to 3000). More advanced systems have also been created, namely the Glicko system, however these are often quite [bloated](bloat.md) and complicated, so Elo stays the most commonly used rating system. Other ways of determining player skills also exist, for example so called accuracy, which says how closely one played to the perfect play according to some strong engine such as Stockfish. The advantage here is that to rate a player we don't need too much data like with Elo (which needs to see many games of the player against other already rated players) -- it may be enough to let the player play a few games against a computer to determine his skill. A disadvantage however lies in how exactly to compute the accuracy because it's a bit complicated by other factors, for example in many situations finding the best move is trivial (like retaking a queen in queen exchange) while in others it's much more difficult, or the fact that humans often DON'T want to play the mathematically best move but rather a bit weaker but more comfortable one, so even grandmasters often choose a weaker move even though they know the theoretically best move.
**[Elo](elo.md) rating** is a mathematical system of numerically rating the performance of players (it is used in many sports, not just chess); Elo basically assigns players a rating number that says how skilled the player is. Given two players with Elo rating it is possible to compute the probability of the game's outcome (e.g. white has 70% chance of winning etc.). The FIDE set the parameters so that the rating is roughly this: < 1000: beginner, 1000-2000: intermediate, 2000-3000: master (currently best humans rate close to 3000). More advanced systems have also been created, namely the Glicko system, however these are often quite [bloated](bloat.md) and complicated, so Elo stays the most commonly used rating system. **Alternative ways** of determining player skills also exist, for example so called accuracy, which says how closely one played to the perfect play according to some strong engine such as Stockfish. The advantage here is that to rate a player we don't need too much data like with Elo (which needs to see many games of the player against other already rated players) -- it may be enough to let the player play a few games against a computer to determine his skill. A disadvantage however lies in how exactly to compute the accuracy because it's a bit complicated by other factors, for example in many situations finding the best move is trivial (like retaking a queen in queen exchange) while in others it's much more difficult, or the fact that humans often DON'T want to play the mathematically best move but rather a bit weaker but more comfortable one, so even grandmasters often choose a weaker move even though they know the theoretically best move. Another idea may be to use a standard set of puzzles, basically like an IQ test. Yet another idea is for example to compute so called [Erdos number](erdos_number.md), i.e. the minimum length of a chain of victories from the world's best player, i.e. for example rating player A with number 3 says he defeated someone who defeated someone who defeated the world's best. A guy called tom7 devised a method for measuring performance of weak chess engines by basically mixing stockfish (the strongest chess engine) with a random move bot in certain ratios -- i.e. making an engine that with certain probability (given by the mixture ratio) plays either a move by stockfish or a random move -- and then determining the mixture ratio at which this monstrosity becomes indistinguishable from the tested engine (i.e. we can say "the tested engine is a mixture of stockfish and random moves in this ratio").
The rules of chess are quite simple ([easy to learn, hard to master](easy_to_learn_hard_to_master.md)) and can be found anywhere on the Internet. In short, the game is played on a 8x8 board by two players: one with **[white](white.md)** men, one with **[black](black.md)** (LOL IT'S [RACIST](racism.md) :D). Each man has a way of moving and capturing (eliminating) enemy men, for example bishops move diagonally while pawns move one square forward and take diagonally. The goal is to **checkmate** the opponent's king, i.e. make the king attacked by a man while giving him no way to escape this attack. There are also lesser known rules that noobs often miss and ignore, e.g. so called en-passant or the 50 move rule that declares a draw if there has been no significant move for 50 moves.
@ -66,7 +66,7 @@ Fun fact: there seem to be **almost no black people in [chess](chess.md)** :D th
{ [This](https://www.youtube.com/watch?v=DpXy041BIlA) is an absolutely amazing video about weird chess algorithms :) And here is a very lovely article about someone's memories of his old competitive chess program: https://www.lkessler.com/brutefor.shtml. ~drummyfish }
Chess is quite interesting for [computer scientists](compsci.md) and [programmers](programming.md), computers not only help people play chess, train their skills, analyze positions and perform research of games, but they also allow mathematical analysis of chess as such and provide a platform for things such as [artificial intelligence](ai.md).
Computers 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.
@ -124,7 +124,7 @@ Here are some notable chess engines/computers/entities, as of 2024:
## Stats And Records
Chess stats are pretty [interesting](interesting.md).
Chess stats are pretty [interesting](interesting.md). Thanks a lot e.g. to Lichess (and NOT thanks to fucking capitalist idiots like chess dot com) we have some great [public domain](public_domain.md) databases of billions of games played between both people and computers, and thanks to chess engines we can generate new and new on demand, so naturally many people create cool statistics, look for patterns and rarities. This can be very insightful and entertaining.
{ Some chess world records are here: https://timkr.home.xs4all.nl/records/records.htm. ~drummyfish }
@ -144,7 +144,7 @@ The **longest game played in practice** is considered to be the one between Niko
**Best players ever**: a 2017 paper called *Who is the Master?* analyzed 20 of the top players of history based on how good their moves were compared to Stockfish, the strongest engine. The resulting **top 10** was (from best): Carlsen (born 1990 Norway, peak Elo 2882), Kramnik (born 1975 Russia, peak Elo 2817), Fischer (born 1943 USA, peak Elo 2785), Kasparov (born 1963 Russia, peak Elo 2851), Anand (born 1969 India, peak Elo 2817), Khalifman, Smyslov, Petrosian, Karpov, Kasimdzhanov. It also confirmed that the quality of chess play at top level has been greatly increasing. The **best [woman](woman.md) player** in history is considered to be Judit Polgar (born 1976 Hungary, peak Elo 2735), which still only managed to reach some 49th place in the world; by Elo she is followed by Hou Yifan (born 1994 China, peak Elo 2686) and Koneru Humpy (born 1987 India, peak Elo 2623). **Strongest players of black [race](race.md)** (NOT including brown, e.g. India): lol there don't seem to be many black players in chess :D The first black GM only appeared in 1999 (!!!) -- Maurice Ashley (born 1966 Jamaica, peak rating 2504) who is also probably the most famous black chess player, though more because of his commentator skills; Pontus Carlsson (peak Elo 2531) may be strongest. { Sorry if I'm wrong about the strongest black player, this information is pretty hard to find as of course you won't find a race record in any chess player database. So thanks to political correctness we just can't easily find good black players. ~drummyfish }
What's **the most typical game**? We can try to construct such a game from a game database by always picking the most common move in given position. Using the lichess database at the time of writing, we get the following incomplete game (the remainder of the game is split between four games, 2 won by white, 1 by black, 1 drawn):
What is **the most typical game**? We can try to construct such a game from a game database by always picking the most common move in given position. Using the lichess database at the time of writing, we get the following incomplete game (the remainder of the game is split between four games, 2 won by white, 1 by black, 1 drawn):
```
1. e4 e5 2. Nf3 Nc6 3. Bc4 Bc5 4. c3 Nf6 5. d4 exd4
@ -155,7 +155,9 @@ What's **the most typical game**? We can try to construct such a game from a gam
23. Qa3 Qc5 24. Qb3 d5 25. Bf1
```
You can try to derive your own stats, there are huge free game databases such as the Lichess [CC0](cc0.md) database of billions of games from their server.
What is **the rarest move**? Some [YouTube](youtube.md) video tried to investigate this with the help of Lichess database. Things that immediately come to mind like en passant checkmates and checkmates by promoting to a knight are rare but not insanely rare. A crazily rare kind of move, which only appeared ONCE in the whole database, was a doubly disambiguatated (i.e. with the necessary specification of both rank and file of the bishop) checkmate by a bishop (specifically Bf1g2#, occurring in a 2022 game) -- this is rare because to need a double disambiguation for a bishop move it is necessary to underpromote two pawns to a bishop and then place them correctly. Yet rarer moves, which NEVER appeared in the database, were a doubly disambiguated knight checkmate with capture and doubly disambiguated bishop checkmate with capture, latter of which was judged less likely and therefore probably the rarest move ever.
Anyway, you can try to derive your own stats, there are huge free game databases such as the Lichess [CC0](cc0.md) database of billions of games from their server.
{ TODO: Derive stats about the best move, i.e. for example "best move is usually by queen by three squares" or something like that. Could this actually help the play somehow? Maybe could be used for move ordering in alpha-beta. ~drummyfish }
@ -218,6 +220,7 @@ Besides similar games such as [shogi](shogi.md) there are many variants of chess
- **chess 960** aka **Fischer's random**: Starting position is randomly modified by shuffling the non-pawn rows (with these rules: king must be between rooks, bishops on opposite colors and black/white's positions are mirrored). The rules are the same with a slight modification to castling. This was invented by Bobby Fischer to emphasize pure chess skill as opposed to memorizing the best opening moves, he saw the opening theory as harmful to chess. Chess 960 is nowadays even advocated by some to become the "main" version of chess.
- **[chess boxing](chess_boxing.md)**: Chess combined with box, players switch between the two games, one wins either by checkmate or knockout.
- **crazyhouse**: When a player captures a man, it goes into his reserve. From the reserve a man can be dropped (as a man of the current player's color) to an empty square instead of making a normal move. This is a rule taken from [shogi](shogi.md).
- **custom starting positions**: Creating custom starting positions is a big fun in itself, for example one can make an epic battle by replacing all pieces with queens, or a very strategic scenario in which both queens are trapped and have to be freed, or an asymmetric battle of many weak men versus a few stronger ones, or trollish ones such as the standard setup, only flipped vertically. Only one's imagination is the limit.
- **different men**: Some variants use different men, e.g. empress (moves like rook and knight) or amazon (queen/knight).
- **duck chess**: After each move players place a duck on an empty square, the duck blocks the square. The duck cannot be left on the same square, it has to be moved. There are no checks, players win by capturing the king.
- **fog of war**: Makes chess an incomplete-information game by allowing players to only see squares they can immediately move to (this is similarly to some strategy video games).