title: What is the lowest ELO ever in history?

text:
# Question
Title: What is the lowest ELO ever in history?
I have a lot of questions about ratings, which are sort of connected, but I think I better split them. This is pair 1.

1. I Googled a bit: By definition, ELO\>100, and someone said (chess.com) he knows someone with 200. I'd prefer "official" FIDE data to hearsay, though. Does anyone have it? (Remember ELO began only at 2200 when it was introduced, with the floor dropping to 2000 later!) Note that I can easily search DWZ (German ELO equivalent), but only for a current year.
2. Assume a chess program that knows the rules perfectly, but makes strictly random moves. I'm sure that experiment is so simple that it has been done yet in the computer chess league. What was the ELO result? (Note that you can't compare this with a human who has just learnt the rules. Those moves will be nonrandom; I'd bet on pawn moves.)

# Answer
> 9 votes
> I googled a bit: By definition, ELO\>100

Well, not really. 100 is the absolute floor for USCF ratings. If your performance would ordinarily set your rating below that, it is simply set to 100. For FIDE ratings, 1000 is listed as the minimum - if you go below that, you get de-listed entirely and have to earn a new rating. There's nothing in the definition of Elo that says 100 has to be the minimum.

If you go to the USCF player search page and search by rating, specifying 100, you will get pages and pages of results. It's fairly common for a kid in their first tournament to lose every game against weak opponents.

If you search FIDE, then you'll get hundreds of results if you specify a rating of 1001, and nothing below that. I don't know why nobody is listed as 1000; it seems statistically impossible to have that many 1001 ratings and no 1000 ratings if 1000 is allowed. Maybe 1001 is the real minimum for FIDE.

In both cases, this is an artificial floor, and if lower ratings were not specifically disallowed by the organizations, they would exist.

# Answer
> 1 votes
1. One detail: the Elo rating, em 1st list (1971) started in 2200. About the people with the lowest rating, you can find this on the FIDE website, on the MegaDatabase, on the website Chess.com, LiChess and other ones. There are some errors in all of them. In MegaDatabase they are mixing BCF and FIDE ratings, so there are several players with 200 Elo and strength close to 2000. In LiChess and Chess.com there are many players using engines in some games, but not in other games, distorting the results. Despite these biases, you can find some useful information.
2. Yes, there are several programs that play pseudo-randomly. There is an old version of Andscacs with the option of random\_moves. Neg 3d, Pos 1.2, ACE 0.1, Brutus RND are some who are supposed to play randomly, but in reality it is not quite like that. In the CCRL ratings, there are several errors among the weakest engines. If you examine the individual games in the database, you will find many winning positions for White in which Black leaves due to an error, or that one program makes an impossible move and the other program loses the point. Another factor to consider is that by playing at random the rating will be higher in games with less time, because opponents will play worse, while the random-player will play at the same level. On the Lc0 website, you can download various rating levels from -1200 to over 3000. In tests with several weak engines and some that supposedly play at random, the worst ones had about 800 rating and the game reasonably similar to a random game. On the Lc0 website, the lowest rating is -1200, but in the tests I did with this engine, the performance was close to 835.

This page have a list of some very weak engines (some of them with errors): http://adamsccpages.blogspot.com/p/also-rans-rating-list.html

---
Tags: history, rating, records
---


# Question
Title: Create a list of discs from PGN file with a lot of comments
I need help to generate structured data from the PGN file as discs into a list in Python, or similar.

For example, say that I need to read this PGN file.

#######################################################

\[Event "Teste\_0-1500 c"\] \[Site "HIGGS-PC"\] \[Date "2021.03.13"\] \[Round "1"\] \[White "Cfish1200-modern"\] \[Black "Cmcchess 2.27"\] \[Result "1-0"\] \[ECO "B33"\] \[WhiteElo "1415"\] \[BlackElo "1330"\] \[Annotator "Boson,Higgs"\] \[PlyCount "160"\] \[EventDate "2021.??.??"\]

1. e4 ({Stockfish 13: (7453kN)} 1. d4 Nf6 2. c4 e6 3. Nf3 d5 4. Nc3 c6 5. e3 Nbd7 6. Be2 Bd6 7. O-O O-O 8. Qc2 e5 9. cxd5 cxd5 10. dxe5 Nxe5

#######################################################

I want to generate a data structure from the first PGN game to generate a list of discs.

\[{'whiteplayer\_name':'Cfish1200-modern', 'whiteplayer\_Elo':1415, 'mainline\_move\_1\_white':'e4', 'mainline\_move\_2\_white':'Nf3', 'mainline\_move\_3\_white':'d4',...,etc.}, {'Engine\_1\_name': 'Stockfish 13', 'move\_white\_suggested\_by\_engine\_1\_for\_move\_1':'d4', 'move\_white\_suggested\_by\_engine\_1\_for\_move\_2':'Nf3', 'move\_white\_suggested\_by\_engine\_1\_for\_move\_3':'Bb5', ... , etc., 'move\_white\_eval\_by\_engine\_1\_for\_move\_1':15, 'move\_white\_eval\_by\_engine\_1\_for\_move\_2':29, 'move\_white\_eval\_by\_engine\_1\_for\_move\_3':37}, {'Engine\_2\_name': 'Eman 6.94 64-bit SSE41 POPCNT', 'move\_white\_suggested\_by\_engine\_2\_for\_move\_1':'e4', 'move\_white\_suggested\_by\_engine\_2\_for\_move\_2':'Nf3', 'move\_white\_suggested\_by\_engine\_2\_for\_move\_3':'Bb5',...,etc., 'move\_white\_eval\_by\_engine\_2\_for\_move\_1':27, 'move\_white\_eval\_by\_engine\_2\_for\_move\_2':30, 'move\_white\_eval\_by\_engine\_2\_for\_move\_3':32,...,etc.}, etc.\]

The same foes for the Black player and other such games. In total, I have around 600 games, each game analyzed by ~100 engines. Engines per game are not the same for all games and not the same number of engines per game. I tried to use chess.pgn, but I am a noob and could only extract the header data and mainline moves.

# Answer
Python has a pgn parser as part of its chess library.

https://python-chess.readthedocs.io/en/latest/
> 2 votes

---
Tags: database, pgn
---


# Question
Title: Is there an origin or story of where the pieces that make a chess game got their name from?
I understand why there would be a king and queen but I would love to know where the idea to call pieces what they are - such as the Rook, Knight, Bishop and Pawn - came from. Is there any background information on the reasons they were called this, and why they were assigned their specific move set?

# Answer
> 20 votes
I believe that the chess pieces are supposed to constitute an army – I'll try to give a breakdown of how each individual name evolved.

Xianqi, or Chinese Chess, originally developed in India before spreading across the world. Xianqi is the Chinese interpretation of the ancient game, and the pieces do really sound like those that would be in an army – General, Advisor, Cannon, Elephant, Horses, Soldiers, and Chariots.

When the game moved to Persia, as referenced by user Akavall in the comments, the Persian word for chariot is "rokh" and is naturally what the piece is called today.

The modern interpretation of chess holds its roots in Spain where one of the final transformations occurred. The General piece became the King and the Advisor became the Queen, as these positions were more familiar in the Western environment. The horses became knights and the elephant became a bishop (I suppose this was influenced by the Church's power during this era). The Soldiers became known as pawns (from Anglo-French poun, or Old French peon).

If you want to read more about this, this link might do a better job explaining it than I did: How Did Chess Pieces Get Their Names?

# Answer
> 10 votes
Origins of chess is from Chaturanga/Chaturang, which the persians pronounced Shatraj (Note that `Shah` means king in persian)

Rook which is basically chariot is called Rath (hindi) or Ratha (Sanskrit) or Rukh (persian)

Mantri/Wazir which means key minister/counsellor, is todays queen.

Ghoda (hindi) and Ashva (sanskrit) means horse which is basically our modern Knight

Hathi which means elephant is our modern bishop

And finally pawn was called Padati, nowadays called Paida (hindi) in short.

According to this article, it went to china much later...

# Answer
> 0 votes
This is not true. The ancient name of this game is called ShadYantra which means 6 principles to manage a war.

The war is fought as per protocols and dharma.. Till today, the same principals are applicable in today's perspective.

1. Knight: Called Ashwarohi. It represents unit of Horses and horse riders headed by Shoorveer.
2. Bishop: Called Gajarohi or Hastin. It represents the unit of Elephants (Like Trucks). Main purpose was to assist the army in resources transportation and migration.. Very rarely used as an offensive and forced to move diagonally (side ways) from the army to avoid damages made to own army.

In Mahabharat Hastinapur means a City of elephants..

3. Rook: Called Maharathi or Rathi.. It represents the chariot or cart carrying the arms, ammunitions, medicines and food. This unit compromised of additional horses, soldiers and charriot riders.
4. Queen: Called Senapati or SeneNayak. This represents the most powerful unit headed by top Army Official. As a joke, modern Chess Players call it as a queen, but it is in reality - Army General.
5. Pawns: Called Padati aur Mooshak (Not rats). This unit represents the foot soldiers.
6. Immortal Peacemaker: Missing in Modern Chess.
7. ArthShastri or PrimeMinister of economics: Missing in modern chess.
8. Vigilance: This royal unit was called Charan, Charak, Char, GuptChars. Missing in modern system. Even in Ramayan and Mahabharat, they arw mentioned.
9. Emperor: The owner of the opponent King after controlling his empire.

The Agastya Suktam, which is 8000 yrs old Samskrit Shloks have these rules mentiond. In Chanakya (Kautilya) ArthShastra which is 2300 yrs old book, this game plan is discussed in too much detail.

---
Tags: history, terminology, pieces
---


# Question
Title: Is it ethical to tell your opponent how you are going to checkmate them?
I play online chess at 3 days per move. I like to tell my opponents how I'm going to checkmate them if they will never win. That way, that I won't waste time continuing the game. I also like to be told if I will be mated for the same reason.

The majority of the users find that insulting. Is it really insulting to tell your opponents how you are going to checkmate them so they can resign fast? I don't play against titled players, so they don't see the checkmate coming unless you tell them. Meanwhile, titled players fight to the end online often, with many games ending in checkmate, unlike real games where you very often resign.

# Answer
> 64 votes
It is not a question of ethics, but more about being courteous. Chess is a game where it is impossible to separate the joy of the game from the competitiveness/ego aspect so by declaring a forced win in N moves, you are effectively asking your opponent to resign immediately even though he hasn't seen the forced win yet **owing to his lesser faculties/skill set.**

Try doing that kind of thing at work/real life .. you'll be out of a job in no time (or get punched in the face) :)

Your opponent may be weaker than you and he may not be able to calculate like you do, but give him the chance OR let him play the game out till the bitter end. You can't just force somebody into resigning by brow-beating them, for God's sake :)

Beyond the probability (however small) that you may be wrong / You may have missed an in-between move or desperado yourself, you are essentially coming off as a jerk. The rare exception is that you are coaching somebody (as part of a mutually agreed session, not one where you suddenly decided to act like a coach! ) where you can afford to **point things** out to them and not come off as arrogant.

# Answer
> 34 votes
> The majority of the users find that insulting. Is it really insulting to \[...\]

I can answer the question based on this excerpt alone. The answer is yes.

# Answer
> 16 votes
I would say this is not only insulting but unethical. Chess is a game that is intended to be a test of thought and concentration. It is unfair for a player to disrupt their opponents thought processes by drawing attention to any particular line of play as it may distract them from pursuing their intended strategy. Now *you* may think that the play is forced from the current position, but what if your opponent has seen something that *you* have missed? Worse still, what if your opponent fails to see that line of play because you had distracted them and resigns?

Now if you and your opponent agree before the game to discuss play while the game is in progress, that is another thing altogether, but as a basic rule, while playing keep quiet and let your opponent concentrate.

# Answer
> 12 votes
It's not like they're going to resign just because someone tells them there's a forced mate. They will try to either:

A) Prove you wrong.

or

B) Know there's a forced mate, but play on just to irritate you.

# Answer
> 12 votes
I guess I've never seen this behavior myself, but while I was reading the question I remembered that, many years ago, when I still read chess books (you know, the ones printed on paper), I read more than once something like "and (put the name of a famous ancient player here) announced mate in 5". Actually, if you google for "announce mate chess", it seems it was usual to do this in the times of Capablanca, Marshall, etc. I don't know if this was considered good/bad etiquette, but I doubt that people like the mentioned above didn't know how to behave over the board.

Edit: I just toke a few more time "googleing". From here it seems it was a good practice in the 19th century: http://en.wikipedia.org/wiki/Glossary\_of\_chess

Here a link by Edward Winters (a prominent figure on chess history) on the topic: http://www.chesshistory.com/winter/extra/announcedmates.html

I wonder if in the times this was an accepted practice, the player who had announced mate, in case to be proven wrong, forfeited the game. I've read assumptions about it, and I'm pretty sure it'd be this way (it somehow fits the spirit of those times), but no "official" confirmation (maybe any old chess manual?).

# Answer
> 11 votes
I don't know why anyone should be offended by this. We are talking about correspondence chess here, even if you play it using a web server instead of through the postal service! The rules of correspondence chess (at least the USCF's) allow players to send "conditional moves" to save time:

> Conditional or if moves: An attempt to save time and postage by offering a plausible continuation beyond the required response. Conditional moves are binding if the recipient accepts the continuations. The game must then follow the indicated continuation or any part accepted in sequence.

One situation where conditional moves make a lot of sense is when there is a forcing line. Forced mates are just one particular example.

Just to give one notable example, according to Wikipedia, in the "Kasparov vs the World" game, "The game lasted four months, with Kasparov playing "g7" on his 62nd move and announcing a forced checkmate in 28 moves." Did Kasparov insult the world? :-)

From a practical point of view, chess.com lets you specify conditional moves. Unlike in traditional correspondence games, your opponents don't get to see all the conditional moves you set, but if they reply along one of the lines you predicted, they receive your next move immediately (and if they don't know about the feature, might wonder how you can alway be available to move so quickly! :-). This allows you finish the game in "autopilot". Personally, that's what I do instead of sending a message announcing the mate, but like I said, I don't think the latter is insulting, either. I only mention chess.com since it's what I know best, but perhaps other providers have similar features.

# Answer
> 10 votes
I don't think that this is very polite nor common. If they are playing so poorly that they don't see the checkmate coming, telling this isn't very helpful for them. They still don't know how to counteract against moves that you are planning to do, so they only become more stressed and probably angry with you, too. Because it's looking like sneering at them - *"Even that I'm telling you what exactly my plans are, you still lose!"*.

# Answer
> 5 votes
Being a "not so good" player I would appreciate that, because I would learn something and next game I will try to avoid the same error. If people is reacting bad, It's a matter of bad attitude. Dude, it's a game!!!

Alex

# Answer
> 3 votes
I guess I don't know about anybody else but I have both had people tell me that they had mate in n moves and have done the same myself. Both are rare but I have never had anyone get mad at me for it or gotten mad and anyone for it myself. I have even been wrong and had someone prove it on the board and have proven others who claimed mate in n moves wrong. My experience playing has been mostly online and I have seen VERY few games go until actual mate.

Especially with a long timer such as days per move I have always been told that one should resign when they know they have lost, and their opponent knows they have won and the person knows their opponent know they have won and know how to finish the game. Not resigning in those conditions is rude, essentially wasting the time the opponent could have spent on another game. If those conditions are not met, or you think you could learn something from seeing how the opponent finishes the game.

All in all I would error on the side of politeness, only mentioning mate in n moves and how if you are sure that it will be acceptable to your opponent, and allowing the benefit of the doubt to them otherwise, assuming that there is still something that they can gain from the game by continuing uninterrupted unless they say something to indicate otherwise.

# Answer
> 3 votes
> Is it really insulting to tell your opponent how you are going to checkmate him so he could resign fast?

I would say no, it's not insulting to announce your plans in correspondence chess. (However, you may not demand resignation.)

Presumably, if your opponent is playing on in a lost position, either he does not know how you are going to checkmate him, or he thinks that you won't actually play those moves. Showing him that there is a mate, and that you do see it, can save some time.

In chess by mail, you can even send official conditional moves stating where you will move next if the opponent replies a certain way - and being by mail instead of through a server, the opponent can obviously see those conditional moves. Far from being unethical, this is encouraged.

You'd better be fairly sure about your moves, however. If you tell your opponent your plans, and they aren't perfect, you may have just helped him to find the weakness.

The above only applies to correspondence-style chess. A live game is different, and you should not announce your plans in a live game unless it is casual and your opponent is OK with it. In live chess, it's more likely that you'll have focus that can be broken; in correspondence-style, you're normally doing many other things between moves and not continually focusing on the game. And in live chess, you have less time in general, and can't take notes to refresh your memory if you get distracted.

# Answer
> 2 votes
**Beware of hubris.** That's the only reason why this would be rude or insulting.

I will tell you how I would handle such a situation, for an increased *friendliness* with the other player. It's almost totally disrelated from the actual strategies of chess; this has to do with interpersonal relationships.

As a fairly decent chess player, I still have a great deal of humility. First of all, if I am only *fairly* certain I have checkmate in three moves, I would not want to assume that there is *zero* possibility that I have overlooked something.

In the case where I have double and triple checked the finite possibilities carefully and know that there is *zero* chance I've overlooked something—I *know* it is mate in three—there is also zero harm (and much benefit!) in communicating it as a *belief* rather than a undeniable certainty, at least at first.

What I would say if I determined I had a guaranteed mate in three is:

**"And, I believe that's mate in three. Do you see any way out?"**

People are much more willing to accept things as true that they see for *themselves.* Of course they shouldn't just believe you. They should see it for themselves. And presenting it in this particular way opens the possibility for a dialogue, which is much more friendly than an adversarial relationship.

In this way you could guide them—without any arrogance or hubris—to be able to see the "mate in three" that you have your eye on.

They will either discuss the possibilities with you ("No, it isn't mate; what if I move my bishop?" "You would think—but don't forget about my rook!") and then finally conclude that it *is* checkmate—or, if you *have* overlooked something, maybe they will see it and the game will continue! And you will have learned something.

Either way is fun. **Why be serious about it?**

---

On the other hand, if your goal is just to prove to other people how much smarter you are than them, then the above method won't work at all. But in that case you have other problems than winning a chess game, like how to make friends. ;)

# Answer
> 1 votes
It is not allowed to talk to your opponent, unless you offer draw. You can discuss the game with your opponent after the game is completed. This is known as the game analysis.

# Answer
> 1 votes
I resign when I know for sure I can't win. Most people I meet play this way. Any time my opponent continues to play, that's fine. I would never tell someone how I will checkmate them. That would be totally rude. Only a fool would do that. Give your opponent the courtesy of letting them figure it out for themselves.

# Answer
> 1 votes
An interesting difference of opinion perennially persists as to whether one has an obligation to resign an objectively lost game—or, by extension, to agree to a draw in an objectively drawn game. No consensus exists. See game 3 for example of the recent Carlsen-Anand world-championship match.

There is this, though. One has little to lose by affording opponents the benefit of the doubt on either side. If your opponent takes umbrage that you would fight a lost position, then consider resigning promptly and politely. It's not worth making an enemy, and it will not change the outcome, anyway (barring a spectacular error by your opponent, whereas you don't really want to win that way, do you?). On the other hand, when one has a winning position, one likewise has little to lose by playing on until one's opponent resigns or one achieves actual checkmate. After all, the beauty of a won position is that *you will win it,* whether now or several moves from now. Your opponent is in no way being rude by playing on. He's just playing chess.

You can afford to be likewise gracious in victory and defeat.

If I had to choose between the two positions though, I would say that it is never proper to demand that an opponent resign, whereas it is at worst slightly obstinate to refuse an opponent's demand for resignation. If your opponent will not resign, then just beat him. When the game is done, shake your opponent's hand and treat him well. It won't take so long. Opponents can have sound reasons for playing out a lost position, after all, reasons that have nothing to do with spite. Magnanimity always becomes the chess player.

# Answer
> 1 votes
Based on answers of itub and D M, I think the spirit of this question is more like

> What's an alternative to telling opponent what I believe is going to be a mate in X?

I mean, who really wants to tell your opponent 'you've lost. you resign now' ?

The answer is to use *conditional moves*.

The thing is...

1. OP has the right idea of saving time when the game is almost definitely won *when you're playing correspondence*.
2. Other answers have the right idea of etiquette *when you're playing live*.

I believe the whole idea of conditional moves is to address this (and many other things). Once you think of conditional moves, there's almost certainly no practical reason to ask this question (in its literal form).

# Answer
> 0 votes
All you need to do is to ask for permission from the other chess player.

But first I would ask myself. Why do I need to tell him, that he or she is going to lose? Am I in a hurry? Do I want to lecture him? Does my ego needs to be fed? What is the real reason?

Once you found the genuine reason, than go ahead. Ask your opponent and reason it. Some might take it as an insult, but if you are respectful and have a valid reason and not just being a nuisance than its fine, in this case there is nothing wrong if you ask. When I say nuisance , I mean for example : you start a 1 hour live chess game and you can see the that there will be a mate in 5, but there is still 30 mins left from his time. Why would you want to hurry the other player? Is there an emergency and you need to leave your chess game? Obviously it can't be such an emergency if you'd still have time to ask the opponent to resign. Or you just don't want to wait the other for half an hour while you know you won? Where is the respect towards your opponent and where is your responsibility of committing yourself to an hour of chess game? Now that is the nuisance. This also applies to other things in life. If the other person reacts badly, you have might been just a nuisance or the other is taking it personally. You need to explain that you have no intentions of offending him/her. If you've done everything fine and the other is still not happy about it, that's fine too! You can't please everyone..

---
Tags: checkmate, online-chess, etiquette, correspondence-chess
---


title: How to calculate corresponding squares

text:
# Question
Title: How to calculate corresponding squares
I saw this question, but it does not answer my question. I was following a Dvoretsky endgame manual and came across this diagram.

Now, I understand why c5 and c7 are corresponding squares and also the same for d6 and d8. I also understood how d6 and c5 intersect at d5 (going from those squares through files and ranks by straight lines and find intersection square) and how d8 and c7 intersect at c8, so the conclusion is that d5 and c8 are corresponding squares.

A few pages later, Dvoretsky introduces this diagram:

I understand why d2 and f3 are corresponding squares and the same for e3 and c3. But Dvoretsky then concludes that based on those 2 pairs of corresponding squares we can conclude with an intersection that c2 and f4 are corresponding squares. How is that? d2 and c3 do intersect at c2. But how do e3 and f3 intersect at f4?

# Answer
I think the term 'intersect' is not really intuitive here.

From c2, the white king can go to d2 and c3 in one move.

That means the black king must find a square from which it can reach f3 and e3 in one move. That square is f4; this would be true for e2 and f2 as well, but then the black king is outside the pawn's square and it can run to promotion.

It doesn't matter that it's not the same geometrical shape on the chessboard. (Actually, it *is* the same geometrical shape if you switch to the Chebyshev distance metric, but I digress.)
> 6 votes

---
Tags: calculation, pawn-endgame
---


# Question
Title: Why, in online chess, is it that the shorter the time control, the higher the world leading elo is?
I noticed on lichess.org that the shorter the time control, the higher the world-leading elo is. Is there a simple explanation for that?

I also noticed that, in the meantime, the shorter the time control, the lower the median is vof all players. I think it is because, the shorter the game is, the more you need to know by heart many openings and the more you need to be skilled to be good at such mode.

# Answer
I think the key of this is number of played games.

Nihalsarin2004 9440 bullet games

konevlad 1113 blitz games

Zhigalko\_Sergei 257 rapid games

Biranidun 84 clasic games
> 11 votes

# Answer
In addition to number of games played, draw rate is a very important factor. The top players will mainly have their ratings brought down by draws against lower rated players. For high level chess, blitz has an 18.5% draw rate compared with a 30.8% for rapid, and 36.9% for classical. Shorter TC allows super-GM level players to do weirder things to bring GMs or IMs way out of their comfort zone, and thus gives them more opportunities to win.
> 2 votes

---
Tags: online-chess, elo, statistics
---


# Question
Title: What projects have been undertaken to solve chess completely?
Chess is not completely solved yet but what efforts have been undertaken to solve it? Has there been a large project like the HGP or is something like that even worth pursuing? What failed efforts have been there if any? I am speculating that the the Alpha Zero project must have taken some steps towards that end.

EDIT:-Answers ponder on the point that is extremely difficult to solve chess which i have clearly indicated in the first line in the question. What I would like to know that are there or have there been any projects that try to solve chess. Like that Moscow university 7-piece tablebases and any efforts like that. It is clearly an expensive problem to solve but who is doing it and what approaches are being taken? It is often said that there are more chess combinations than atoms in the universe (probably because of that ad) but so are the real numbers but we have a rich theory about that. We also know a great deal about the universe as well but we had to try hard to get to that point. Is chess being treated the same is my question.

# Answer
*Endgame tablebases* can be seen as such an effort, in that we started at few pieces and have increased the number. In 2012, 7 piece tablebases -from Moscow state university were generated, so chess is solved for positions of 7 or fewer pieces (including the kings).

The problem is, the 7 piece tablebases take about 140 TB in storage. 8 piece tablebases would take about 10 petabyte of storage, and a computer with 50 TB of ram (source) to keep hashes in memory to generate them in reasonable time (a few years?). I guess it would be doable these days if someone makes the millions of dollars available. 9 seems way out of reach.

So it will take a while before we get to 32.
> 43 votes

# Answer
7-piece endgame tablebases were completed in 2012. 8-piece endgame tablebases is the next logical step. This page says a little about how those are going (context is searching for the longest forced mate in pawnless positions):

> Many show interest in what is to expect from \[8-piece\] endings ... Unfortunately the size of \[8-piece tablebases\] will be 100 times larger than size of \[7-piece\] tablebases. To fully compute them, one will need about 10 PB (10000 TB) of disk space and 50 TB of RAM. Only top 10 supercomputers can solve \[8-piece\] problem in 2014. So don't hold your breath expecting new breakthroughs too soon - the first 1000-move mate is unlikely to be found until 2020 when a part of a TOP100 supercomputer may be allowed to be used for solving this task.

If we get 8-piece tablebases one day (*if* we get them) that'll be the next step to solving chess, but we don't expect to get them for many years more at least. Even if they are created, they'll take huge amounts of disk space to store.

In principle chess will be solved when we have 32-piece tablebases, but if 8-piece tablebases are this hard to create, we are not going to solve chess in the foreseeable future, AlphaZero or not.
> 19 votes

# Answer
AlphaZero has no intention of solving chess. It's just an engine that plays spectacularly well. The number of positions you'd have to evaluate in order to solve chess is larger than the number of atoms in the universe, so even if you could solve chess (which is nowhere near the capabilities of the current capability of all computers on Earth combined), you wouldn't be able to store the entire solution anywhere
> 15 votes

# Answer
It is funny that you bring up mathematics and the universe as things we know quite a bit about. Yet neither of these fields is 'solved'. Moreover, neither ever can be.

Mathematics can never be fully solved due to Goedel's Incompleteness Theorems. There will always be true facts about numbers that we cannot find proofs of.

As with the Universe, we can never know the full 'state' of the universe (eg what every atom and subatomic particle is doing) precisely due to theHeisenberg's Uncertainty Principle. We can never hope to tell what is going on outside the observable universe due to relativity.

So in some sense, they are pretty fair comparisons to chess. We know a lot, but due to universe we live in, we will never know it all.

The best I believe we can hope for in terms of solving chess would be an ultra-weak solution (possibly involving some strategy stealing) that proves a eg a forced draw (or better) for white from the starting position without explicitly solving how.

For an interesting article about endgame table-bases and methods for solving games, *check* out this. Checkers (a MUCH simpler game) was solved to be a draw over a decade ago

**EDIT To clear up some confusion:**

As pointed out in the comments, the unsolvability of these three systems are immensely and qualitatively different. The incompleteness theorems derive from first principles and would hold up in ANY universe. The unsolvability of the state of the universe is based on the physical laws of the one we live in. The unsolvability of chess is only due to the fact that the universe we happen to live in is too small and chess is too large for a (strong) solution to be held inside it. The reason they are similar here are pure coincidence, simply a by-product of universe we all happen to inhabit.
> 6 votes

# Answer
Can't answer your main question, but to the point about alphazero: from my perspective, AlphaZero, although it may be a major step in superhuman performance in games, is not even a minor step towards solving chess.

> if we could follow A0 with big investment maybe it can take us very far into uncharted territories

I don't think this is true. Its approach, which is to explore the game-tree by picking paths which have high probability of being good, doesn't seem to have much implication to fully solve chess. Although it may be very very good at being very very good at chess, I think this heuristic-based approach is less viable to exactly solving chess than you think.

To be very charitable, maybe... and by maybe I mean this is a pie-in-the-sky thought that just came from my dumb brain... maybe the AlphaZero work could someday lead to a proof that with training, the model converges to a model that plays correctly with probability 1 (and `1` in this case is aka 99.999...%), but even this may not be considered "solving" chess as we still cannot not prove that any model we have trained in real life makes every move correctly.
> 6 votes

# Answer
Others have already mentioned tablebases and their development, but something that hasn't been touched on yet is the sheer space complexity of chess.

In order to say that chess is solved, we need a function `gameState -> move`, and that function needs to be defined for all possible states of the game, or at least all of the ones that are reachable within the rules of the game. There are vastly more of these than there are atoms in the observable universe. So even if we could somehow encode each game state and its corresponding best move into a single atom, there isn't enough matter in the universe to build the server that would run the database.

Endgame tablebases are interesting, but there's nobody who's seriously attempting to solve chess.
> 4 votes

# Answer
Shirish Chinchalkar has a paper which calculates an upper bound of ~10^46 for the number of positions in chess (different from moves obviously). Arguments which talk about the number of atoms in the universe are very facetious on account of using position differences (we can only get to a position from another, so why not just store what piece moved instead of the whole new position?) as well as compression. IIRC, in the Syzygy endgame tables, each position can be represented by less than a single bit after taking into consideration compression.

One thing that I personally wonder, and I could be completely wrong, is whether there would be at a certain point a relative small decrease in complexity as n -\> 32 as there will be less starting nodes.

It's an amazing question though. I would love to see it (even weakly) solved in my lifetime.
> 2 votes

# Answer
Another line of attack is reducing dimension: Gardner's 5x5 minichess has been weakly solved by Mehdi Mhalla and Frederic Prost in 2013. 3x3 and 3x4 boards have been strongly solved in the 2000s with complete tablebases for each position by Kirill Kryukov, and 9-men tablebases for 4x4 chess have been completed in 2011 by the same author.
> 2 votes

# Answer
I think the other answers and comment have made it clear that this is a really complex problem. So complex, that no classic computer will ever come close to solving it.

But I have asked myself the same question. Isn't chess a perfect example to use a quantum computer? Although quantum computers are not yet fully ready for use there do exist "programming languages", and there are already many algorithms for a quantum computer described this way. There actually even exist simulators for running these quantum computer "programs" on classic computers.

I wonder how feasible it would be to write an algorithm for solving chess on a quantum computer. Or would that require so many qbits, that we can never expect an actual quantum computer that could run this algorithm? But if it would once exist, shouldn't it be able to answer the question within a second?

Just to clarify, since I mentioned the possibility to simulate these algorithms on classic computers. This simulation of course only makes this very complex problem solved even less performant, so those simulators could only be used for testing of the algorithm, not for really using it.
> 1 votes

# Answer
Nice question. The wikipedia page Solving chess also report only endgame tables as partial results.

Personally, I believe that tools from **combinatorial game theory** are essential to solve chess completely (unless by something similar to an exhaustive search; I would argue that the machine learning method is under the hood an exhaustive search \[plus some pruning-type techniques\]). Don't expect the the machine learning tools to be of help here if you think the solution should build a chess theory. Combinatorial Game Theory (CGT) is the study of combinatorial games. Chess is not a combinatorial game. But, tools from CGT sometimes do a good job of (partially) solving games which are not combinatorial (e.g.: dots and boxes).

See papers \[1\] and \[2\] for a taste of what to expect.

By the way, the fact that generalized chess is computationally hard says practically nothing about chess.

Linked resources:
\[1\] Qingyun Wu, Frank Yu, Michael Landry, A combinatorial game theoretic analysis of chessendgames.
\[2\] Noam D. Elkies, On numbers and endgames: Combinatorial game theory in chess endgames.
> 1 votes

# Answer
I think everyone here has a good and necessary point with the space complexity of chess being larger than the number of atoms in the observable universe. However, I think I can add some additional points onto that.

1. As others have pointed out, the definition of "solved" is not super clear. If "solved" means "find the optimal move from any possible game state", solving chess is impossible. However, if we take solved to mean that we just want to play the single "perfect" game of chess we may be able to reduce space complexity.
2. The problem with point one is that chess does not have a single perfect game. A perfect game of chess implies that you are always making the move that leaves you with the highest chance of winning. It also implies that you are accounting for your opponent making optimal moves, as otherwise it would not be a perfect game (and would also break the previous space complexity issues). However, chess is a well balanced game and any game perfectly played would necessarily end in a draw.
3. There are likely a near-infinite number of optimally played games that end in a draw. While the number of optimal moves from any position is much smaller than the number of possible moves, according to the best chess engines we have today there are many moves that have near-optimal results from the starting position and in the first few moves. Because a significant advantage is needed to win any game of chess, many of these moves would likely be included in a "perfect" or solved game.
4. Lastly, how would you prove my points 2 and 3 right or wrong? You can't. Again, you run into the space complexity issue. To prove any position is either winnable or unwinnable if both players play optimally, you need to diagram out every single possible move from a given position. As we have shown earlier, this is impossible until we are below a certain piece number.
> -1 votes

---
Tags: theory
---


# Question
Title: Why don't I have more success with the King's Indian Attack?
My last opening of choice as White was the King's Indian Attack to avoid having to learn a lot of opening lines, it being a system opening. I've read Eric Schiller's and Ken Smith's books on the KIA. I get the planned control of e5 and the desired strong piece and pawn presence on the kingside for an attack but rarely seem to be able to bring home the point. The sample games I look at always seem to find strong continuations. Am I just seeing the successful games? Does this suggest basically a tactical shortcoming on my part, or could I be missing something else critically important that I need to know about the opening for complete understanding? I seem fairly tactically astute in open games. I might add that I haven't been particularly successful with the companion King's Indian Defense either. Maybe positional play just isn't my forte.

The following game is the most recent KIA from several days ago against the computer, which although flawed by the blunder on move #30 yet will illustrate what I'm talking about.

```
[FEN ""]
[White "Conero"]
[Black "SparkChess"]

1.Nf3 g6 2.d3 d5 3.Nbd2 Bg4 4.g3 Bxf3 5.Nxf3 e6 6.Bg2 Nf6 7.O-O Bg7 8.c3 O-O 9.Qc2 Nc6 10. Bf4 b5 11.e4 Ng4 12.Rad1 f5 13.Rfe1 fxe4 14.dxe4 Nf6 15.e5 Nd7 16.h4 a5 17.a3 a4 18.Bh3 Nc5 19.Ng5 Qe7 20.Qe2 Rab8 21.h5 h6 22.Nf3 gxh5 23.Nd4 Qe8 24.Nxc6 Qxc6 25.Qxh5 Qe8 26.Qg4 h5 27.Qg5 Ne4 28.Qh4 c6 29. f3 Nc5 30.g4? Rxf4 0-1

```

# Answer
> Am I just seeing the successful games?

Of course! If you were writing a book trying to sell / promote a particular opening you wouldn't call it something like "How to Lose with the KIA". Nor would you fill it full of games where white played the KIA and lost. You'd fill it full of games where white won.

> I get the planned control of e5 and the desired strong piece and pawn presence on the kingside for an attack but rarely seem to be able to bring home the point.

Hey! You know what? That's chess. It's a pretty even game. The thing is, every time you move your opponent gets a move too. There is no forced win for white from move one and nor is there a forced win for either white or black at the end of the "book" part of almost all openings.

Your realistic aim should be to get a good playable position out of your chosen opening with white, a position you feel comfortable in, one where you know and understand the plans that follow from that particular opening. Then it's an even game. If your opponent understands the position and plays it better than you then he will likely win. If not and you both play it with equal understanding and ability it will be a draw. Only if you play the resulting positions better than your opponents will you win.
> 10 votes

# Answer
I think the main mistake people make when playing the KIA is to play for the kingside attack regardless of the position, and assuming that they are automatically going to get Fischer-Myagmarsuren by playing the same moves as white each time, regardless of what black does. If you look at modern GM games in the KIA, these kind of attacks are a rarity because everyone has seen the old Fischer and Benko crushes from the 60s and knows how to defend against them.

Others have pointed out that 15.e5 is a mistake, and the subsequent attempt to play for a non-existent kingside attack which black fends off quite easily. White is better centralised and has the two bishops, and black's queenside pawn structure is a bit loose, so opening the position with 15.exd5 makes more sense. After the e-file opens up, the e6 square also looks very weak. Off the top of my head, 15.exd5 exd5 16.Ng5 looks quite annoying for black to face.
> 6 votes

# Answer
The result of this game has nothing to do with the opening.

I would like to point a nice combination you could have played and that is quite typical for KIA: give a piece to open the opponent castle.

At move 22, instead of retreating the knight with 22.Nf3 you can get a complex attack with:

22.hxg6!? hxg5 23.Qh5 threatening mate on h7, and then

* 23...Bh8 24.Bxg5 Qd7 25.Rxd5!
* 23...Rfe8 24.Bxg5 Q-a.l. 25.Qh7+ Kf8 26.Bh6 followed by Qh8
* 23...Rxf4! 24.gf4 (24.Qh7+ Kf8) gf4 with a mess.

In diagram:

```
[fen ""]

1.Nf3 g6 2.d3 d5 3.Nbd2 Bg4 4.g3 Bxf3 5.Nxf3 e6 6.Bg2 Nf6 7.O-O Bg7 8.c3 O-O 9.Qc2 Nc6 10. Bf4 b5 11.e4 Ng4 12.Rad1 f5 13.Rfe1 fxe4 14.dxe4 Nf6 15.e5 Nd7 16.h4 a5 17.a3 a4 18.Bh3 Nc5 19.Ng5 Qe7 20.Qe2 Rab8 21.h5 h6 22.Nf3 gxh5 (22.hxg6!? hxg5 23.Qh5 Bh8 (23...Rfe8 24.Bxg5 Qd7 25.Qh7+ Kf8 26.Bh6) (23...Rxf4!) 24.Bxg5 Qd7 25.Rxd5!) 23.Nd4 Qe8 24.Nxc6 Qxc6 25.Qxh5 Qe8 26.Qg4 h5 27.Qg5 Ne4 28.Qh4 c6 29. f3 Nc5 30.g4? Rxf4

```
> 3 votes

# Answer
I took a liberty to embed your game into the answer.

```
[fen ""]

1.Nf3 g6 2.d3 d5 3.Nbd2 Bg4 4.g3 Bxf3 5.Nxf3 e6 6.Bg2 Nf6 7.O-O Bg7 8.c3 O-O 9.Qc2 Nc6 10. Bf4 b5 11.e4 Ng4 12.Rad1 f5 13.Rfe1 fxe4 14.dxe4 Nf6 15.e5 Nd7 16.h4 a5 17.a3 a4 18.Bh3 Nc5 19.Ng5 Qe7 20.Qe2 Rab8 21.h5 h6 22.Nf3 gxh5 23.Nd4 Qe8 24.Nxc6 Qxc6 25.Qxh5 Qe8 26.Qg4 h5 27.Qg5 Ne4 28.Qh4 c6 29. f3 Nc5 30.g4? Rxf4

```

It is a pretty decent game until `15. e5`, which strikes me as anti-positional. It releases a tension in the center (mostly rendering your Rooks passive); it blocks your dark-square Bishop; it creates a target for Black Bishop. Having played it nevertheless, I would consider an entirely different plan involving a Knight sacrifice at `e6`, starting with `16. Ng5` threatening the fork, and `17. Ne6` followed by `18. Bd5`.
> 2 votes

# Answer
How is Black supposed to defend after 13. Ng5? The idea is that it knocks out Black's defense of the d5 square, hence the a2-g8 and h1-a8 diagonals because if Black plays something like 13... Re8 14. Nxe6 Rxe6 15. exd5 White wins material.

The answer the original question is that Black lets you take their stuff and you don't just take it to the bank.

```
r2q1rk1/p1p3bp/2n1p1p1/1p1p1p2/4PBn1/2PP1NP1/PPQ2PBP/3R1RK w - - 0 13

1. Ng5 e5 2. Ne6 Qd6 3. Nxf8 exf4 4. Ne6 fxg3 5. hxg3 dxe4 6. dxe4 Qxe6 7. exf5 gxf5 8. Qb3 Qxb3 9. axb3 Nge5 10. f4

```

It’s just a sample variation, but hopefully it can be seen that Black's vulnerabilities on the h1-a8 diagonal can be exposed if White choose to play smashmouth chess.
> 2 votes

# Answer
If your rating is up to 1400 at least, you probably need to develop planning skills.

Silman's "How to Reassess your Chess" is a highly recommended book by many chess players. It covers planning based on imbalances.

If you have a strong player look over some of your games, they will likely be able to point out something you are misunderstanding.
> 1 votes

# Answer
15. Ng5! looks almost winning to my eye.

The e6 pawn is a very serious weakness. Playing 15.e5 makes it harder to pressure that weak pawn, while 15. Ng5 (with ideas of Bh3 and the like) ties Black down. I don't see any way for Black to defend
> 0 votes

# Answer
The most likely reason is you.
You are not as good as your opponents.
That would be the obvious reason.

Perhaps also that the KIA does not really fit your chess abilities as well as some other opening. Do you win at higher rates against the same people with a different opening?
> 0 votes

# Answer
There are already excellent answers. But, I would like to add something. In hypermodern-style openings, timing is very important. In these openings, we (almost) give up center in the beginning only to strike back at an opportune moment. This is why many answers here readily point out that in your game exd5 fits in much better (than the move played e5). This particular move may not be common in the KIA games you see. But, one has to think and play flexibly to get practical chances. Although king's Indian attack is cut out for king-side attack, sometimes you have to go for queen-side attack (or on both wings).

Most importantly, **you have to really look out for the opportunities.**

In your game, the following are examples of continuations I would analyze (not necessarily play).
1} 13.exd5 exd5 14.Qb3 (with Ng5 to follow)
2} 20.Be3
3} 24.Nxb5

The move 15.Ng5 given by John Smith here also looks like an opportunity to seize the initiative.

I recommend focusing on your weaknesses when you play against actual people (rather than computer); psychology is a big factor in making hypermodern openings work. Best wishes.
> 0 votes

# Answer
Learning openings at below 1800 makes absolutely no sense. And even above -\> I'd up to 2100 it makes no sense to seriously study openings, as you do not have the proper skills to convert what ever achieved (either make a draw from an equal position or win from a better position). Of course, you need to know some stuff to not lose immediately or fall for any traps. But with ratings \<2100 your aim should be to first learn to play decent chess!! -\> Hence I totally agree with over-the-board and also his recommendations!! So work hard and play hard -\> and if there's a chance also hit hard ;-D (btw: its always hard to come up with some rating bounds -\> those I mentioned are just a rough direction ...)
> -2 votes

---
Tags: opening, kings-indian-attack
---


# Question
Title: Players who play fast in longer time control games
I see it all the time on the net. Some players play, for example, a 15-minute game with a 10-second increment, and they finish the game with more time than what they started with! I've heard players doing this even in OTB tournaments- games that could go on for hours on end.

Is it because they are perhaps too impulsive? (And if so, why not just play bullet?). Or do they like to just use their gut? Is it also a bit an ego thing, as in, "I can beat this guy even if I don't think at all!". Or is it also a part of their strategy, they want to get their opponent in time trouble?

So what are the possible reasons why they play so quick?

# Answer
> 30 votes
As I commented, there are several reasons why people play fast, among them:

One of the reasons I often see is fear of time trouble. Many amateurs are not really aware of whether the time they have left will "be enough", so start to move way too fast early on. They won't feel confident to play faster games either for that same reason.

It could be the case that your opponents are using your time to think if you take too much time, so when it's their turn they've already anticipated your move and figured out how to answer.

Other players want a challenge, so they will play a game in 5 minutes against an opponent who has 15.

The list could be infinite...

# Answer
> 18 votes
> I see it all the time on the net

It also happens a lot over the board.

There are two main reasons players play the moves very fast when they have a lot of time:

1. They are in their preparation and the game may conclude (with a win or pre-arranged draw) before they leave their preparation. You often see this at the highest levels.
2. They are sufficiently far along the autism spectrum to have problems maintaining a long attention span.

On the second point there is an English IM who will often finish a G90+30 FIDE rated game with only 5 minutes gone on the clock. I played in the same club team as him when he was about 10 or 11 years old (and he was obviously much weaker). At the time the only way I could beat him was to play deliberately slowly and avoid tactics. If he was bored then mistakes were far more likely to come. When he was interested he was very quick and very good, far too good for me.

Now there is a player for a club in the same league that I play in who clearly also has the same Asperger's-like medical problem. A few years ago I played him in a 10+5 rapid tournament. He wrote the moves down and won on time with more than 3 minutes left on the clock albeit in a probably losing but very complicated position, far too complicated for me in a rapid game. When I played him again a year or so later at standard time controls I won because I could use the extra time while his condition prevented him from doing so.

# Answer
> 13 votes
I think the biggest reason is that using your time efficiently is an acquired skill just as learning tactics is.

When you are not as strong, you do not know as much, and thus, you do not have as much to think about. As you acquire more overall chess skill, you have more to think about, and thus, you spend more time thinking. It is also a matter of practice. The more practiced you are, the better you are at time management.

Also, there is another factor, and that is the proliferation of kids in chess. When I started playing 40 years ago, there were virtually no kids playing. I was the kid at age 18 back then. Now, they seem make up at least half of chess players at the tournaments I have been to lately. Kids naturally think very quickly, and thus, they do not need as much time to think as I do now at age 58 (in a few weeks).

# Answer
> 11 votes
It's also a possible strategy to play with the opponent's mind by playing quick and ideal (or *unexpected*) moves, though it can be very risky and backfire.

Depending on how mentally strong a player is, seeing a few quick and ideal moves done in a succession by the opponent may pressure their mind. If they cannot cope up with the pressure, a blunder may be made even while having much time left.

Another way is to play quick moves that end with an unexpected move. This may surprise the opponent even more, make them thinking something else unrelated to the game (like "why did they play *that* move?") and wasting more time thinking if they miss some obvious moves.

However, if the opponent is not provoked and still stays calm, then it may backfire to the player if the (unexpected) moves are actually not good moves since they are practically reducing their winning chance.

# Answer
> 5 votes
I don't see my situation pointed out by anyone here, so I'll add an answer:

I have been, for quite some time, playing only (online, of course) bullet games. On chess.com, out of 3889 games, 3192 are bullet. And on lichess I have 2634 bullet games out of 3215 total games.

Recently, I decided that I want to stop playing bullet, and I started focusing on blitz and rapid games. However, after about 500 games, I still finish most 5+0 games with more than 3 minutes and a half on the clock, and if I play 15+10 chances are that I will end with more than 15 minutes.

There's not strategy in it, I'm not trying to deceive the opponent or to buy some "buffer time" for the mid and end game, I have just been playing bullet for such a long time that my brain is "wired" this way and rarely I take more than 10/15 seconds to think I move. I even play fast in correspondence games!

# Answer
> 4 votes
It's a long list indeed.

One of the reasons I prefer such games over bullet games is it gives me a buffer. If I encounter a tricky situation, I have time to think about it. In Bullet games, you *must* play fast. In longer games, it's optional. If I don't need much time for the first 10 moves, I may still need a lot of it for the next 10. Especially with online chess where you often don't know your opponent, there's a major risk something unexpected will happen.

# Answer
> 2 votes
From my personal experience - I'm one of those people who generally plays fast even in long time controls, and a lot of it is because I don't really know what to do with all that time... Usually I'll look at a position for a minute, maybe two at the most, and play whatever is the best move I see - because my own experience is that at that point I'm not going to see anything better, no matter how long I think about the position. I kind of get "tunnel vision" on whatever I see quickly, and no matter how hard I try to look at other things, I keep going back to whatever I saw quickly and trying to figure out how to make that work. I play in a league where the time control is 30/90, SD/60, and I routinely finish my games with only 20 to 30 minutes used off of my clock. I know this is bad (I lose a lot of my games...), but I'm still trying to figure out how to break out of that pattern.

# Answer
> 0 votes
## List of main reasons

1. By habit from playing lot of blitz/bullet games (example)
2. In an attempt to avoid 'overthinking' the position (similar answer)
3. The player is impatient
4. To buy time for a later part of the game (example)
5. To gain a psychological advantage (example)
6. The player is in his/her preparation (example)
7. The player has less experience with clock and/or afraid about losing on time (example)
8. Playing with handicap for practise/fun (see this answer last paragraph)

---
Tags: time-control, time-management
---


title: Chess in comics

text:
# Question
Title: Chess in comics
Not sure if this is the right place...

I would need no help in compiling a list of chess movies or even chess literature scenes. Comics, though, are a more fleeting medium, and here a list would be much harder to come by. (Obviously I googled beforehand, a bit has been done already.) I prefer examples with actual plot relevance, though, and with actual valid chess. (E.g. Prince Valiant pulling the good old stalemate-with-living-pieces defense.) The obscurer, the merrier.

But specifically (and that's my real question), for 40 years I'm looking for the source of:

a) a Mickey and Goofy adventure. They have to solve a chess problem. Goofy being Goofy inadvertently misplaced a piece, leading to a wrong solution and the good old ACME trapdoor.

b) a SF in a B/W magazine (Eerie or Creepy would be my first guess), where chess is never even mentioned, but as a FM, I immediately recognized the spaceship formations as executing a smothered mate (metaphorical plot relevance alert!).

# Answer
I don't know if this suits your question. Here is a recent reference in a web comic. Sandra and Woo by Novil and Powree.
> 2 votes

---
Tags: reference-request
---


title: What is Indian Castling exactly?

text:
# Question
Title: What is Indian Castling exactly?
Western castling doesn’t exist in historical Indian Chess (Chaturanga). Instead, in some versions, there is a cool move whereby each king can once in the game make a knight's move.

I read that it is can’t be used after check. But is that correct? Is it indeed a right which is lost for good after being checked, or is it something which cannot be exercised *while* the king is in check, but the right will return after the check no longer applies?

I guess I am hoping that it can be exercised even when in check, because it’s so cool to have a chance to escape otherwise certain loss - like James Bond.

How do the two kings interact directly? Must they avoid being a knight move apart. And if one has used its ability can the the other check it allowing bare K to checkmate e.g. K+N?

And how universal in Indian chess is this rule, please?

EDIT: The reason for this is that I think that Chaturanga can be interesting for chess problems, particularly retrograde analysis, but we need to agree a standard "canonical" version of the rules. The get-out-of-jail-free card is a unique mechanism like nothing else in chess, but I can't find a clear definition of how anyone uses it.

EDIT 2: Some relevant links:

The last link given is the most relevant, see John Gollon's account. However, I submit that the text is not clear, and I'm looking for another primary source.

# Answer
I was reading through "American Chess Magazine Volume 1" on Google Books, which is from 1897. There is an old article on the origins of chess therein, with the basic summary of how the game to be: it's reminiscent of today's Wikipedia as it was at the time. To my surprise, on page 264, there was direct mention of what you speak of! It occurs when speaking of chess's predecessor, Shatranj, which itself is a form of the much older, four-player game Chaturanga, aka "Indian Chess."

Here is the relevant text.

> The King was limited Shatranj, as in our game, to a move of one square in any direction, except that once during a game he was allowed the move of a Knight ; *i.e,* from his own square to King's Knight's second square, to King's Bishop, third square, to Queen's third square, or to Queen's Bishop's second square. This Knight move was omitted and Castling substituted.

At the end of page 265, it says:

> In all variations of Chaturanga, the common origin is shown by the retention of one object, viz.: the capture of the opponent's King. When this is accomplished it is a checkmate, "Shiek-Mate," the death of the King--the game is finished.

So there is a primary source, I suppose. It seems to me that the special knight move can only be used by an unmoved king. Also , reading into it, that an opponent can walk their king into a king's knight move range. Shatranj is a variation of Chaturanga, I think, and if the goal is to capture the king. So "stalemate" as we know it doesn't exist, and therefore so doesn't check. I admit that this interpretation of the check is my opinion, so it is still unclear, but what is clear is where on the board "Indian Castling" can take place.
> 5 votes

# Answer
Chaturanga is a local variant played by Indian traders. This variant was created only 1400 yrs ago from ShadYantra or ShatRanjan (not Shatranj)..

In older version Board Castling happened in real but not like Rook King exchange.

KING possesses scepter or RaajDand. King and minister resides in Palaces marked with X signs. There were 8 places in total in King's state.

In indian Castling, king had to consult any Royal team member and could go to castle again.. but Castle was not present in Chaturanga (variant played by local traders)...

King can do castling unlimited number of times and no such rules to disallow king to save his life were present..

With due course of time, the dashpaad board (10×10) went in secret exile along with Kautilya Arthshastra. Ashtpada board(8×8) had no Castle and fictional castling was introduced by Arabs and Europeans.
> 3 votes

---
Tags: rules, history, chess-variants, castling, kings
---


# Question
Title: How has chess managed to remain a competitive sport despite engine dominance?
As much as people fear losing their jobs to machines that can do them better, Chess has seen the exact opposite take shape. There have been extremely strong chess bots since Kasparov's time, and more recently, the supremacy of chess engines has only been reinforced by neural network engines like AlphaZero.

Yet, people seem to have just accepted the fact that the skill gap between engines and human players is insurmountably vast, and chess has, in the face of human obsolescence, continued to grow even more popular. More people play the game, and more importantly, people continue to compete. Moreover, prize pools have only gone up as chess becomes an attractive eSport with some matches easily attracting tens of thousands of viewers.

My question is: how? How has human competition endured when even the best players perform at a level that's barely child's play for any run-of-the-mill engine? Now that we have "accepted" that we are worse, why do we still want to see who's better?

Chess isn't the only example of this happening either - spelling bees, certain eSports, and even weightlifting competitions are all fields where machines can do the task better, faster, and more reliably. What does this pattern tells us about how human society as a whole will adapt to increasingly powerful machines as they arrive?

# Answer
> 71 votes
For the same reason the Tour de France is still a thing even if you could perform much better on a motorbike. Most chess enthusiasts didn't stop playing chess after noticing there's some other person whose rating is 1000 points higher than theirs, and won't stop because there's a machine 1000 stronger than that person.

A good amount of chess players don't care at all about computer chess and will only use engines as an assistence to analysis.

# Answer
> 28 votes
An analogy often used here is to compare people to cars. Sure, cars can travel far faster than people like Usain Bolt, but that doesn't mean it's not entertaining to watch. When people watch players like Carlsen play chess, they're still watching the best humans in the world compete. Sure, being the best human no longer means much since there are stronger beings out there (engines), but this could already be the case for many things. There are probably aliens out there who are far superior to us in every way. Does that negate everything we do as pointless? Everyone has their role to play in this game of life.

# Answer
> 19 votes
> As much as people fear losing their jobs to machines that can do them better, Chess has seen the exact opposite take shape.

That's because chess is a game. People enjoy playing it, and they enjoy watching other people play it. You can't really compare it to something like tilling the fields on a farm, where most people only care about the result and not the process, and so are perfectly happy to let machines do it instead of people (except the people who lost their jobs when machines replaced them; but even they don't generally enjoy it enough to do it for free).

> My question is: how? How has human competition endured when even the best players perform at a level that's barely child's play for any run-of-the-mill engine?

Because the humans don't need to compete with computers. This is because people care about who is the best chess player, but not about who is the best farmworker. Part of the reason they care is because many people who aren't professionals play chess for fun.

> What does this pattern tells us about how human society as a whole will adapt to increasingly powerful machines as they arrive?

Not much, since you can't compare chess to most jobs. Maybe you could extrapolate that things people enjoy doing, or enjoy when other people do, will remain.

# Answer
> 9 votes
Arguably, chess is more exciting today because of computers rather than despite computers.

Chess engines have had the side effect of eliminating adjournment from tournament play and generally led to faster time controls. Rapid (or even faster) games tend to be fairly exciting games, which has increased interest in the game.

Also, the same rise in computer technology which has led to unbeatable chess engines has also created a truly international playing field. One can go online and play chess against players from all over the world. This is in strong contrast to when I was learning to play in the 1980s. I would go to my school's chess club and play the same people week after week. For people outside of major cities with strong chess clubs, chess-playing tended to be somewhat parochial and thus somewhat boring. Nowadays you have strong players from all over the world. In the past, many of these people would have been too isolated to develop their chess-playing skills to their true potential.

# Answer
> 8 votes
> Now that we have "accepted" that we are worse, why do we still want to see who's better?

Computers aren't human beings. They can't compete with us for any of the important things of life as outlined in Maslow's hierarchy of needs. Only other living beings can do that and, as we've ably demonstrated our dominance against other species, our main competitors are other human beings.

Jordan Peterson has famously described the importance of the dominance hierarchy dating all the way back to lobsters.

In the chess world, no less a figure than Bobby Fischer when asked what his greatest pleasure is in chess replied:

> When you break his ego. This is where it is at.

A computer doesn't have an ego to break. It is not alive. How good they are at implementing a set of algorithms to play chess is completely irrelevant.

# Answer
> 6 votes
Sport is about human excellence, humans competing against one another and fun.

The fact that a computer can do something much better than a human might take a bit away from human achievement, but ultimately:

* It's still impressive to see someone else doing something you can't do, or few others can do.
* Getting better still gives a sense of achievement (which is true for the top player in the world as much as it is for any random person in the middle).
* It's still as competitive as ever between humans (if not more so due to between-game assistance computers provide, which is, to a reasonable degree, available to anyone and can provide insights that may otherwise only have been available to very few players).

It could be competitive even between amateurs that are much worse than the best players out there, which is at least somewhat comparable to competition between the best players in the world that are much worse than the best computers out there. Although it does add a little something to be the best human at some activity.
* It's still fun to play and watch.

# Answer
> 2 votes
Man is a competitive person by nature. The computer is a machine that is manufactured to perform one or more specific activities, but the number of tasks it can perform is limited. But who made them was man, there is a mind beyond that makes algorithms, and sequences so that it can do its assigned tasks in specific environments. The man can self-develop the tools to combat any type of task, in any circumstance, environment or environments. As a result, there is still so much activity in chess and in so many other areas in which man has a machine as a competence because that is the way in which he realizes that there are people or machines better than them, and that something extraordinary must be done. work daily to improve yourself. Something that characterizes outstanding humans is the growth mindset.Man is a competitive person by nature. The computer is a machine that is manufactured to perform one or more specific activities, but the number of tasks it can perform is limited. But who made them was man, there is a mind beyond that makes algorithms, and sequences so that it can do its assigned tasks in specific environments. The man can self-develop the tools to combat any type of task, in any circumstance, environment or environments. As a result, there is still so much activity in chess and in so many other areas in which man has a machine as a competence because that is the way in which he realizes that there are people or machines better than them, and that something extraordinary must be done. work daily to improve yourself. Something that characterizes outstanding humans is the growth mindset.

# Answer
> 1 votes
We now have human chess and computer chess. Anybody who wishes for the strongest chess playing possible, head to the TCEC chess championship. Human chess is headed by Carlsen. There are two champions playing very different chess under very different playing conditions.

# Answer
> 1 votes
An additional reason to what is already mentioned, from the eyes of a spectator/enjoyer of the game, is that computers play chess in a way that is either hard to understand for humans or very dry and boring. Computers tend to slowly grind for a slight advantage, preferring to not take "risks". A risk in chess is in essence not having calculated all possible replies to your move (and higher order replies). Seeing that computers check most moves, they will often find counterplay to a move that might seem like a terrifying attack to a human. If the computers would be given free reign, we would probably see mostly the same game being played all the time (computers are usually given a certain opening to start from to create some variation in their play).

Humans, however, make interesting choices based on chess principles, typical ideas, strategies, mistakes by their human opponent, and so on, and thus have more personal styles of play. There's also a psychological factor that is lacking with computers, which makes the game interesting to play and watch.

---
Tags: engines, psychology, streaming
---


# Question
Title: Does the King's Indian Attack need the e5 pawn push to attack on the kingside?
So from what I understand, a kingside attack can be started as long as the centre is closed. I very recently started looking into the King's Indian Attack as an opening for white against the French and e6 Sicilians, but since I don't see many of either of those at the 1500 level on chess.com, I have only been able to try it out this one game.

Draws are very rare at my level but I just didn't know what to do by move 29 with my attacking chances completely gone and I guess neither did my opponent.

This is the game:

```
[Event "Live Chess"]
[FEN ""]
[Site "Chess.com"]
[Date "2021.04.06"]
[Round "-"]
[White "Me"]
[Black "Black"]
[Result "1/2-1/2"]
[CurrentPosition "r3r3/1bp3p1/1pn2p1k/p3pPpP/3pP1P1/P2P1BN1/1PP2K1R/7R b - -"]
[Timezone "UTC"]
[ECO "B00"]
[UTCDate "2021.04.06"]
[UTCTime "07:50:38"]
[WhiteElo "1506"]
[BlackElo "1443"]
[TimeControl "600"]
[Termination "Game drawn by agreement"]
[StartTime "07:50:38"]
[EndDate "2021.04.06"]
[EndTime "07:59:52"]

1. e4 Nc6 2. Nf3 e6 3. d3 d6 4. g3 Nf6 5. Bg2 Be7 6. O-O O-O 7. Re1 e5 8. Nbd2
Re8 9. h4 h6 10. Nf1 Bf8 11. Ne3 d5 12. Nh2 d4 13. Nef1 Ne7 14. f4 Nc6 15. f5 b6
16. g4 Nh7 17. Nf3 Be7 18. h5 Ng5 19. Bd2 Bb7 20. Qc1 Nxf3+ 21. Bxf3 Bg5 22. Ng3
Bxd2 23. Qxd2 Qg5 24. Qxg5 hxg5 25. Kf2 Kh7 26. a3 a5 27. Rh1 Kh6 28. Rh2 f6 29.
Rah1 1/2-1/2

```

So is the reason this was so terrible because I missed some great continuation, or does the attack just not work when I don't have a pawn on e5, since I started reading King's Indian Attack Move by Move by Neil McDonald and he puts quite a bit of emphasis on it. So if I commit to the KIA with 3.d3 and my opponent plays 3...d6, not allowing any e5 push, I should just open up the position and be left with a slightly worse opening?

I felt like my worst blunder was basically just creating an outpost for the black knight on g5 but even before that I didn't seem to be getting anywhere. Could anyone help me understand why this went so terribly and how I should know for next time that a kingside attack isn't a good idea?

# Answer
> 10 votes
It's not the KIA at fault (in fact we saw here a color-reversed KID) but you both lacked when it comes to positional play.

* In the end position, Black is far better. He can act the standard queenside pawnroller while you don't have the slightest attacking counterplay, and a horribly bad bishop.
* But since so much material has been traded, Black probably didn't have the nerve to press on. (I would have, but then, I tend to win all endgames :-) Specifically, c4 is his only decent plan and you can hope to throw off the bishop.
* Specifically, what went wrong was that you were "forced" to h5, after that all breakthroughs go through the window. Given that you stand so bad after that, I had played g5 nevertheless and at least got some open lines for the pawn.
* You could have avoided to be "forced" by carefully preparing the attack: king to f2 and place a dozen rooks behind your pawn roller. Shall he argue with *that*. (Likewise, Black should have uncompromisingly rolled on the queenside. In KID, you must queen a few pawns and sacrifice the queens against the material that wants to mate you ;-)
* I'm not even sure if f5 wasn't a bit early.
* So, get the "Kmoch" (argueably, a bit ancient - the new "Shankland" is also nice) and learn about pawn play (especially levers). Get the "Vukovic" (likewise ancient) to learn how to attack a castled position, especially when to storm with pawns and when to attack with pieces. The good news is: Positional play will come automatically to you the more you learn and the more pattern you encounter. Practice.

# Answer
> 3 votes
First, to address your question, "So if I commit to the KIA with 3.d3 and my opponent plays 3...d6, not allowing any e5 push, I should just open up the position and be left with a slightly worse opening?" - I am tempted to say yes, play something else in this case but in no way you are "worse" after losing a tempo after, say, d2-d3 followed by d3-d4.

Regarding the game, 18.h5 was the end of all your attack, but I understand you "had" to play this since h4 was attacked and you had no other way to save this pawn. Yet, this just means that the mistake has been done earlier, so your 16. g4 allowed this situation to occur and should have been prepared better. I do realize it might have been difficult for you to foresee the necessity of pushing h5 two moves later, but hopefully now you will be aware of such situations and plan accordingly.

Moreover, 18. g5 was something to consider too, trying to open up some files at cost of one pawn. It is probably not great objectively, but practically you do get what you wanted (kingside attack) (maybe).

Another (minor) thing is that 7. Re1 was premature (you do this to support your e5 pawn), but later in the game you see that your rook would have been better placed on f1. It looks like you learned a certain set of moves typical for the KIA when black plays e6 and d5, and you were trying to play it no matter what. This is rarely the best approach though.

---
Tags: strategy, attack, kings-indian-attack, kingside
---


# Question
Title: Unable To Communicate with UCI through Java Program
I am writing a java program to connect to the Stockfish Engine and get the best move for some FENs. My Connection code is :

```
public class connector {
    private Process engineProcess;
    private BufferedReader processReader;
    private OutputStreamWriter processWriter;
    private static final String Path = "path\to\stockfish.exe";

    public boolean startEngine() {
        try {
            engineProcess = Runtime.getRuntime().exec(Path);
            processReader = new BufferedReader(new InputStreamReader(
                    engineProcess.getInputStream()));
            processWriter = new OutputStreamWriter(
                    engineProcess.getOutputStream());
        } catch (Exception e) {
            return false;
        }
        return true;
    }

    public void sendCommand(String command) {
        try {
            processWriter.write(command + "\n");
            processWriter.flush();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

    public String getBestMove(String fen, int waitTime) throws IOException, InterruptedException {

        sendCommand("position fen " + fen);
        sendCommand("go movetime " + waitTime);
        return getOutput(waitTime + 20).split("bestmove ")[1].split(" ")[0];
    }

    public String getOutput(int waitTime) throws IOException, InterruptedException {
        StringBuffer buffer = new StringBuffer();

        try {
            Thread.sleep(waitTime);
            sendCommand("isready");
            while (true) {
           String text = processReader.readLine();
           System.out.println("Text is " + text);
           if(text.equals("readyok"))
              break;
           else
              buffer.append(text + "\n");

          }
          catch (Exception e) { e.printStackTrace(); }

        return buffer.toString();
    }

    public void stopEngine() {
        try {
            sendCommand("quit");
            processReader.close();
            processWriter.close();
        } catch (IOException e) {
        }
    }

}

```

My Driver Code is as Follows :

```
connector con = new connector();
        boolean started = con.startEngine();
        if(started) {
            Thread.sleep(1000);
            String bestMove = con.getBestMove("1nbqkbnr/1ppppppp/p7/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1", 5000);

            System.out.println(bestMove);
        }else {
            System.out.println("Failed To Start Engine");
            System.exit(0);
        }

```

The Output I am getting is :

```
java.lang.ArrayIndexOutOfBoundsException: Index 1 out of bounds for length 1
at connectors.connector.getBestMove(connector.java:42)

```

I am having a hard time understanding what is wrong with my code. I understand that using processReader , I am reading the InputStream of the engine and appending it to String "text" until I encounter "readyok" , and finally returning this string. But when I output this , it gives me everything including info like

`info depth 1 seldepth 1 multipv 1 score cp 539 nodes 83 nps 41500 tbhits 0 time 2 pv e5f6 info depth 2 seldepth 2 multipv 1 score cp 790 nodes 182 nps 91000 tbhits 0 time 2 pv e4d5 b7b6 e5f6`

I am unable to get the Best Move. How can I do this?

# Answer
`info depth 1 seldepth 1 multipv 1 score cp 539 nodes 83 nps 41500 tbhits 0 time 2 pv e5f6 info depth 2 seldepth 2 multipv 1 score cp 790 nodes 182 nps 91000 tbhits 0 time 2 pv e4d5 b7b6 e5f6`

obviously doesn't have any best move in it. Stockfish needs time to give you a move. Your program will need to filter out those principal variation lines.

Please don't use `waitTime`. Did you ask for 20 seconds? Chess engine may not stop the search exactly after 20s. Do something like this:

* Wait from Stockfish in real-time. In C++, it's something like `read()` (can't remember exactly without a Google search). Your worker thread waits for the next Stockfish output.
* Check if "bestmove" is in the line, if not, do nothing

Pseudocode looks like:

```
f = ... // handler to Stockfish's standard output
while (true) {
    line = f.read() // Read Stockfish's next line. Blocked if nothing.
    if ("bestmove" in line) { // Best move?
        ... parse the move ...
    } else {
        print("Do nothing!")
    }
}

```
> 4 votes

---
Tags: stockfish, uci
---


# Question
Title: Do chess programmes keep a history of the full board for each move?
I am creating a chess GUI for UCI engine as a hobby. I keep the history of moved positions (e.g., (4,6) -\> (4,4) for the pawn in front of the white king moving forward 2 squares) and the type of the moved piece (e.g., pawn), and some minor states like castling, capturing, etc).

Now I am trying to implement checking for draw conditions. At first, I thought it was about repeated moves, but after seeing the official rules, it seems that it is about repeated positions. **Is it practically possible to check for this without keeping the snapshot of the whole board (in my case, a 8x8 integer array, 256 bytes) for each move?** I thought about taking a hash value of the board, but even if I take a `long` value, it can only represent 2^64 values, and according to a quick search, the number of all possible positions is about 10^120, so hash collisions will occur.

# Answer
> 23 votes
You are doing a chess GUI, not a chess engine right?

Chess GUI doesn't need to be super efficient, because you have no more than a chess game to look for. Even a game over 200 moves about the world record is absolutely nothing for a computer.

I would just simply keep your positions with an array of strings like FEN format (or any other format), and then simply linear scan the whole game for repetitions.

If you want to get fancy, try https://marcelk.net/2013-04-06/paper/upcoming-rep-v2.pdf.

# Answer
> 4 votes
Most programmers only record the move (and some other key flags) played and only the position it's thinking about.

A move structure often contains the move, castling rights, move ply, 50 move ply, EP square, and, and a hash value. (Depending on how involved you want the AI, you may add other data, such as what the computer evaluates this position to help with the AB search.) By restoring the flags and using simple logic to retract the move, a previous position can be restored.

# Answer
> 3 votes
There is only little memory required for the purpose of checking the rules for remis: Either party can request a draw when a position repeats three times or there is no pawn move or capture within 50 (or is it 70?) moves. In your GUI, you may want to *automatically* end the game in a remis in such a condition (even though formally this has to be requested by a player).

Then note that you never need to keep track of more than 50 positions because whenever a pawn moves or a piece gets captured, no previous position can ever repeat any more, i.e., you can clear your history and start afresh. On the other hand, if you do collect 50 positions without pawn/capture, then the other remis rule kicks in.

# Answer
> 3 votes
I wouldn't worry too much. It is true that there are 10^120-ish possible positions, but you won't have to worry about most of them. To specify a position, you only need a FEN string. You can therefore keep track of the FEN strings corresponding to all positions that were reached during a game and check if one of them appears three times for the draw condition to activate.

While you may want to define "hashes" and then make a second check if three positions have the same hash, I don't see how this could be a significant improvement over the brute force method.

# Answer
> 2 votes
You might want to consider computing a Zobrist Hash of each position, and checking for three occurrences of the same hash. Hash collisions, as you mention, are possible but rare.

If you want you could use this in combination with storing the list of moves made (since space seems to be a concern this should require much less space than storing the board state after each move) and then, in case you detect the same hash occurring three times, you could check for a false positive by using the list of moves to recreate the three positions and verify that they are, in fact, identical.

# Answer
> 1 votes
Firstly, I wouldn't worry about tracking board state history, computers are powerful enough that modern frameworks like React, can afford to basically store the entire history of your interaction with a website, just because it makes debugging and writing tests way easier.

But if you really want to, here's how I'd do it efficiently: You don't need to store the entire board, since it's mostly empty. It can have a max 24 occupied positions out of 64, so you only need to store those. The only other thing you have to worry about, is whether the king can castle(because technically, 2 identical board states are different for the purpose of the draw rules, if the king can castle in one and not the other).

So you have a board position, represented by an unsigned short, of which bit 0 is black/white, 1-3 is row, 4-6 is column and 7-9 is piece\_type.

You have a board struct

```
{
unsigned short positions[];
byte num_positions
}

```

The positions are stored in the order(doesn't matter, it just has to be consistent, so they can be compared) of Ascending row and Ascending column within row. And to efficiently compare 2 boards: check if num\_positions is the same, if not(one piece has taken another) return false, loop through positions, if board1.positions\[n\] != board2.positions\[2\], return false, return true.

Another way to do it, would be to have a struct with:

```
{
unsigned short pos1,
unsigned short pos2,
...
unsigned short pos24
}

```

less space efficient, but equality comparison is simply board1 ^(bitwise XOR) board2 \> 0

Then, for the game, you have a Stack, that you push each new board state onto as a player makes a move. i.e.

```
boardHistory.push(latestMove)

```

If something happens that obviously invalidates the 3 repetition rule, like a piece being taken, promoted, or castling no longer possible, toss the old boardHistory, i.e.

```
boardHistory = new Stack<BoardHistory>(latestMove)

```

When you search for repetitions, you only have to search a small stack for two repetitions, because it will get cleared repeatedly throughout the game and the board comparison is very efficient as well.

# Answer
> 0 votes
You seem to not understand the concept of a hash. The whole point of a hash is that it is lossy compression. A lossy compression by definition allows collisions. A collision being theoretically possible and a collision occurring are two very different things. The probability of two random numbers hashing to the same `long` is one in 16 billion billion. So unless your program is being used a *lot*, the chances of seeing a collision is tiny.

Storing all the moves is hardly much of an imposition. The maximum size of a packet is 2^16 bytes, so if you're storing the board as 256 bytes, then you can fit up to 256 moves in a single packet.

On top of that, there are lossless compressions you can use. A basic one would be to store the location of each of the 24 pieces, for 48 bytes. You'd have to deal with removed and promoted pieces, so say 52 bytes. More complicated systems can bring that down.

You can also just store each move; the board state then can be reconstructed from the move history. You can combine this with hashing; if none of the hashes match, you know none of the board states match. If the hashes do match, then you can spend the effort reconstructing board states. Once every 16 billion billion moves, a hash collision will require you to reconstruct a board state unnecessarily.

You can also dump your history every time a piece is captured or a pawn moves, as the board state can't repeat from then on.

# Answer
> 0 votes
You'll want to store the move history anyhow, because that record is useful. The move history is tiny.

You'll probably store a hash of each board position. While it is true there are only 2^K hash values, and the birthday paradox says that these will have a decent chance of having a collision in a universe of 2^(K/2) items, the point of hashing isn't to make comparison faster. Only after you find a hash collision do you need to compare board states.

So your snapshot can be highly compressed. An example of a valid snapshot is the series of moves used to reach that state; from it, you can generate the board state; this isn't unique, but we don't care, as we don't compare the move sequence, we compare the genearted board.

There are certainly better ways, but that will only matter if you have a huge database of every chess position; and by that point you should be organizing your chess positions in a more interesting manner than "board state" anyhow (like, by material first, then equivalence classes of material positions to game solutions).

So keep track of each move, and a map from the hash of the board position to the indexes of the moves with that hash. Then to detect a draw, when you add to that hash-\>index, actually generate the board for each of them and compare them for equality.

Even with a 32 bit hash, it takes an average of about a 32,000 length game to have a decent chance of **one** false collision here (birthday paradox; a random bucket of N numbers has a decent chance at a collision at O(sqrt(N)) elements). So the performance impact of false checks is going to be small; the number of times you'll have to "wastefully" generate the boards and not have a collision is going to be tiny.

In fact, you'll have to work hard to force that to happen, so you'll want good unit test coverage of that case.

# Answer
> -1 votes
The accepted answer points out that a GUI doesn't need to be so fast. But if you did want to work on an engine, consider this: 2^64 is a really big number. By the birthday paradox, you will need 2^32 board positions, on average, to find 2 duplicates. If we assume that all positions are just 1 move away from a draw (an absurdly conservative estimate), that says that on average it will take 4 billion positions to come up with a collision.

Even in a chess engine, which has to worry about trees of moves, not just a linear stream, you only have to look within the current branch for positions that draw, so the collisions can only come from that line. Even if we made another extreme assumption that the game lasts less than a thousand moves, there is a 0.0000232% chance of finding a collision.

Finding a collision is like mis-scoring the board. It makes the board evaluate to a draw, even though it may have been a win. So unless your engine's rate of mis-scoring boards is less than 1 in a million, these collisions can be handwaved away.

And, obviously, if one does occur, you can always check the game history to be sure.

# Answer
> -1 votes
Your actual question is which data structure to use to find repeated board positions.

It is irrelevant how many theoretical chess scenarios there are; the most relevant "big number" in this context would be the maximum length of a *concrete* game you want to support. As of right now, the longest recorded chess game had 269 moves.

This is a ridiculous low number for a current device (no matter if a PC or a smartphone or even just one of the nicer microcontrollers).

To be guaranteed to be correct and still easily humanly understandable, you could find a representation of the board as an explicit array (i.e., list off all pieces with their X/Y coordinates and a special mark if removed). A naive implementation would need 7 bits per piece to encode position on the board and whether it was taken already; or let's call it 8 bits for ease of programming. This means 32 bytes (due to 32 pieces) to encode the whole board (1 byte per piece). 32\*269 is somewhere between 8 KB and 9 KB of storage. ( * )

At this point I would immediately stop looking for optimized solutions, the numbers are just too small. I would err on the side of making the code easier to maintain and develop, to avoid errors, and make for a more pleasant programmer experience.

To find duplicates, depending of your programming language, you could use a hash/dictionary (with the encoding of the board, i.e. the 32 bytes, as key; and the number of occurrences as value). If your language of choice has no easily usable hash data structure, you could keep a sorted list of these 32-byte tupels and do a simple linear scan operation to look for repeated numbers. I would not go to the excess of creating an involved tree structure or anything like that at all.

As to your literal question on how chess programs do that: I have not looked at the source code of any chess program, but as a programmer, I would simply use whatever data structure is most comfortable, and comes "out of the box" with the required operations (in the form of a standard library of my programming language) to re-use, and to avoid re-inventing the wheel. There are other aspects than duplicate detection: e.g. at some point your program *needs* the explicit information about which piece just moved from where to where (to be able to display just that movement on the screen, possibly in an animated fashion).

At some points your program *needs* a complete representation of the board (i.e. if you want to be able to mouse-over a piece and highlight it, to show the user that he is about to "pick up" this piece). And so on. All these things factor into which data structure to use, and it is not unheard of to have multiple structures available in parallel when there is so little data involved. So there surely is no final answer on how the GUI of a chess program stores this.

---

(\*) Side note: This is just the first naive data structure that comes to my mind. One would need to take a little care to build the array in a way that the *order* of equivalent pieces (i.e. all the black pawns) does not matter, but this would be relatively simple and left as an exercise for the reader. The point of the answer is to show any one algorithm with relatively little RAM usage, not the best or most elegant algorithm.

# Answer
> -1 votes
My exploration of Quantum Chess does, in a way.

When any move is made, a copy of the board is made, then the move is performed on the copy (and any other copies where that move is valid). In this way, there is always a copy of the board for each state the board has been in throughout its history.

---
Tags: programming
---


# Question
Title: Is there a chess program that can detect if someone has left the game?
I was playing a game with someone and they left because they knew they were going to lose. This is a really annoying thing that has happened to me. I would like to know if there is a chess program that knows if someone has switched to another screen.

# Answer
Chess.com detects it as well. If they by chance disconnect due to internet issues, it will show a bar that fluctuates based on wifi strength. They have a certain time to reconnect.

Chess.com additionally gives warnings and will ban that user if they consistently leave matches, so you don't have to worry about them.

For a chess program that can check if they switch screens, I doubt that as of late. It may be possible to check servers, but that could cause an invasion of privacy, as well as consent needed to "share screen" or some sort. If you have suspicions, you can send a message to the developers and tell them, and chess.com allows you to review your opponents accuracy and time of moves, to check if they truly have been making moves they shouldn't have been able to.
> 2 votes

# Answer
Lichess (http://lichess.org) has some ability to detect when your opponent has left the game. When that happens, it gives your opponent a brief chance to rejoin, then allows you to claim a victory or a draw if they do not rejoin. If Lichess detects that your opponent has left, it will show a counter counting down the seconds until you can claim victory. The amount of time on the counter seems to depend on the time control and other factors. If Lichess does not detect that your opponent has left, but they decide to run out the clock, Lichess will not allow you to claim a victory, but will still automatically penalize your opponent with a ban after repeated offenses.

Note that none of this happens in correspondence chess, as temporarily leaving the game is normal in that time control.
> 5 votes

---
Tags: online-chess, cheating
---