title: How to install stockfish on ubuntu?

text:
# Question
Title: How to install stockfish on ubuntu?
Is there an easy guide how to install stockfish on ubuntu?

From the main site I can not find any information and github repository does not provide many details.

I would really appreciate if someone who already installed and started to run it would share the steps.

# Answer
Just for completeness, I would like to add more explicit instructions for using stockfish in Scid, because sometimes it is a little confusing how to get stockfish to function in an actual chess program.

```
sudo apt-get install scid
sudo apt-get install stockfish

```

Load Scid In Scid Click:

```
Tools -> Analysis Engine (click twice) -> New
    Set Name to ‘stockfish’
    Command is /usr/games/stockfish (use ‘which stockfish’ if not)
    Directory : Click the ~/.scid button
    Hit OK and select the stockfish engine

```

Hopefully this is straightforward enough that anybody could replicate it.
> 30 votes

# Answer
As probably you already know Stockfish is "only" a chess engine. It means it's "only" the part of the program that makes the thinking, and it has no interface at all.

I haven't used Ubuntu for a while, but AFAIK Stockfish is available on its repositories, so you should be able to install it just by: $ sudo apt-get install stockfish

If for whatever reason you need/want to install Stockfish from the sources, once you've downloaded the code from the github repo, you just need a C++ compiler (v.g. g++) and from the "src" folder enter the command: $ make build ARCH=x86-64 (This is for 64-bit systems) $ make build ARCH=x86-32 (This is for 32-bit systems)

In order to be able to play against Stockfis you need a chess GUI, for example Arena (only windows version, so you need wine in order to make it work) and ScidVsPC are vey popular: http://scidvspc.sourceforge.net/ http://www.playwitharena.com/

Once you've installed a GUI and the Stockfish engine, you just have to add the Stockfish engine to the GUI in order to be able to play against it.
> 7 votes

# Answer
I would recommend that you download the engine from https://stockfishchess.org/.

Unzip the zip file and go into the src folder.

```
unzip stockfish-7-linux.zip
cd stockfish-7-linux/src

```

Call the make script i.e.

```
make build ARCH=x86-64

```
> 5 votes

# Answer
Don't use apt-get because it doesn't give the latest Stockfish version. Do this:

```
wget https://stockfishchess.org/files/stockfish-10-linux.zip
unzip stockfish-10-linux.zip
chmod +x stockfish-10-linux/Linux/stockfish_10_x64
./stockfish-10-linux/Linux/stockfish_10_x64

```
> 5 votes

# Answer
I suggest you simply use this command in your Terminal:

> sudo apt-get install stockfish
> 4 votes

# Answer
The package is referenced at http://packages.debian.org/sid/i386/stockfish/download which can be installed with aptitude or synaptic.

Try this Link for more info
> 3 votes

---
Tags: engines, stockfish
---


# Question
Title: How to play against an engine using scid for a particular level?
The best free chess program SCID vs Pc is installed and the latest chess engines are installed. After watching video Jeremy Silman, to play for first low level then intermediate and then Master level.

How to configure the SCID vs. PC to select a Particular chess engine , to play Low level or intermediate or then Master level ?

# Answer
> 2 votes
Manage your engines in **Tools**.

Select your engine in **Play**.

Configure the engine, then select your skill level.

---
Tags: engines
---


# Question
Title: If a chess board is disturbed, can the game continue?
Let's say I'm playing a game that has technically begun (white has moved) and then the board is disturbed: say a minor earthquake shakes the pieces off the table or something. Clearly no-one has interfered so there is no cheating, but what happens next?

If the moves are logged, can the pieces be returned to their previous positions and the match resumed? Or must the match be aborted and the board reset?

I'm mostly interested in the international tournament rules but I'm interesting in hearing of 'house rules' as well.

# Answer
From the FIDE Laws of Chess, article 7.6:

> If, during a game, it is found that any piece has been displaced from its correct square the position before the irregularity shall be reinstated. If the position immediately before the irregularity cannot be determined, the game shall continue from the last identifiable position prior to the irregularity. The game shall then continue from this reinstated position.

Put into practice:

* If the moves are logged, then it's trivial to determine the "last identifiable position" and the game can be resumed as if nothing happened.
* If they are not logged (or the two scoresheets differ), the arbiter can attempt to find the "last identifiable position" by asking both players. If they both remember the exact same position, then the game can continue from that position.
* If that fails too (because the players don't remember or disagree), there is at least one "last identifiable position" that can always be determined, the starting position. So yeah, the game is essentially reset in that case.

Article 7.1 applies basically the same rule to the readjustment of the clock, if there is one (with some more wiggle room for the arbiter):

> If an irregularity occurs and the pieces have to be restored to a previous position, the arbiter shall use his best judgement to determine the times to be shown on the chessclock. This includes the right not to change the clock times. He shall also, if necessary, adjust the clock’s move-counter.
> 26 votes

---
Tags: rules, chessboards
---


# Question
Title: Touch move rule when the opponent is not present on the board
According to the rules, if a player touches a piece, he/she has to move that piece (if it's possible), and so on...

Imagine this situation, the opponent is not present on the board (far away), you touch a piece and the opponent (or somebody else) claims that you have to move that piece, can you deny it?

One can claim that *I've said j'adoube* or *I adjust*, and the opponent weren't here to hear it.

My idea is, while the opponent is not present on the board, it is OK to touch the pieces, but does the rule have anticipated this situation?

# Answer
Article 4.3 of the FIDE Laws of Chess (the touch-move rule) also applies if the opponent is not present. But let's split your question up a bit:

> Imagine this situation, the opponent is not present on the board (far away), you touch a piece and the opponent (or somebody else) claims that you have to move that piece, can you deny it?

**In dubio pro reo. (When in doubt, for the accused.)**

Unless there is any other evidence (e. g. the arbiter or a spectator observing you), if you deny having touched a piece, the arbiter should declare that there is not enough evidence to support your opponent's claim (the burden of proof is on the claimant).

Not admitting that you touched a piece when you have in fact touched it, however, **is one of the most immoral things you can do in a game** \- exactly because of this issue.

> My idea is, while the opponent is not present on the board, it is OK to touch the pieces, but does the rule have anticipated this situation?

I would suggest a different approach that avoids all confusion: **Call the arbiter to your board** and tell him you intend to correct the position of some pieces - that's what the arbiter is there for. If no arbiter is in sight, a more practical approach would be to say "I adjust" clearly while e. g. making eye contact with a neutral bystander to make sure you can prove you did not intend to move a piece.
> 14 votes

# Answer
Article 4.3 of the FIDE Laws of Chess states:

> 4.3 Except as provided in Article 4.2, if the player having the move touches on the chessboard, **with the intention of moving or capturing**: ...

So if you touch the piece in such a way (for example pushing it with your pen or your little finger) that it is clear that you don't have the intention of moving or capturing it, it should be OK.
> 2 votes

---
Tags: rules
---


title: Is the open Catalan a gambit?

text:
# Question
Title: Is the open Catalan a gambit?
I have been looking at the open variation of the Catalan game, where White seems not to extremely worry about conceding the pawn with 4...dxc4, going for calm development instead. One notorious example is the below game where Black eventually gives back the material playing 9...b5 without (apparent) preparation; however, I do not see why this is necessary and the questions is whether the underlying idea for White behind this opening is to just gambit without really looking at any way of taking back the c4 pawn unless re-offered.

```
    [fen ""]
    [Event "WCC Match 2006"]
[Site "Elista RUS"]
[Date "2006.09.23"]
[EventDate "?"]
[Round "1"]
[Result "1-0"]
[White "Vladimir Kramnik"]
[Black "Veselin Topalov"]
[ECO "E04"]
[WhiteElo "2743"]
[BlackElo "2813"]
[PlyCount "149"]

    1.d4 Nf6 2.c4 e6 3.Nf3 d5 4.g3 dxc4 5.Bg2 Bb4+ 6.Bd2 a5 7.Qc2 Bxd2+ 8.Qxd2 c6 9.a4 b5 10.axb5 cxb5 11.Qg5 O-O 12.Qxb5 Ba6

```

Another example is this other below game where again Black gives back the pawn after quite a few moves although it seems it could have defended and kept it, had it wanted to, preparing ...b5 after proper set up and development. I have purposely chosen to display games by Kramnik as he is a major player of the Catalan games and I assume his continuations in these positions are theoretically correct (hence it all boils down to what Black chooses).

```
[fen ""]
[Event "Corus"]
[Site "Wijk aan Zee NED"]
[Date "2007.01.21"]
[Round "8"]
[White "Vladimir Kramnik"]
[Black "Magnus Carlsen"]
[Result "1/2-1/2"]
[ECO "E04"]
[WhiteElo "2766"]
[BlackElo "2690"]
[TimeControl ""]
[Time ""]
[PlyCount "55"]
[EventDate "2007.01.13"]
[Annotator ""]

1. Nf3 Nf6 2. c4 e6 3. g3 d5 4. d4 dxc4 5. Bg2 a6 6. O-O Nc6 7. e3 Bd7 8. Nc3 Nd5 9. Nd2 Nb6 10. Qe2 Na5 11. Nde4 Be7 12. Nc5 Bc6 13. Bxc6+ Nxc6 14. Nxb7 Qc8 15. Nc5 O-O 16. N5a4 Nb4 17. Bd2 Rd8 18. a3 Nc6 19. Rac1 Rb8 20. Rfd1 e5 21.Nxb6 cxb6 22. Qxc4 exd4 23. Ne4 dxe3 24. Bxe3 Rxd1+ 25. Rxd1 Qb7 26. Rc1 Ne5 27. Qc7 f6

```

Does White play a gambit in the open Catalan or is the c4 pawn doomed to be taken back necessarily, at some point in the game?

# Answer
Generally it seems to me if you want to keep the pawn on c4 with b5, white can play a4 which is cumbersome for black as protecting the pawn on b5 with c6 or a6 runs into pins on the a file or the h1-a8 diagonal. Even if you did manage this setup with pawns on a6, b5, c6 and c4 and maybe the bishop on b7 (or moving the rook out of the pins), black's light-squared bishop is very passive and moving any of these four pawns will create weaknesses or lose a pawn.

So yes, you could call it a gambit I guess.
> 2 votes

# Answer
As far as i understand the Catalan is a variation of the queens gambit, so yes, it is a gambit. However, like in the regular queens gambit, in most lines white gets the pawn confortably back, black has to run big risks to keep it. Not to mention that you can play 5.Qa4+ to get the pawn back immediately, though this is not the most ambitious approach.
> 1 votes

# Answer
In short, no, a priori the Catalan opening is not a gambit, because unlike the Queen's gambit, in Catalan `d5` is played *after* white's `c4`, which means white is *first* to decide whether to take on `d5` immediately or let black take on c4. Whereas, to clarify the contrast, in the Queen's gambit, `1. d4 d5 2. c4` black is the side with the tempo to decide whether or not to take on `c4`, thus, white is clearly sacrificing a pawn. This observation is also consistent with your examples.

In the case white leaves the matter unresolved, and allows black to take on `c4` (for instance in your examples), then sure white has decided to play in the style of queen's gambit, with `g3`. If you wanted, you could call it *a delayed queen's gambit accepted with `g3`,* but in fact it more commonly goes by the name of *Open Catalan*.

Terminology discussions aside, let's now delve a bit deeper into the role of `c4` in the Catalan and Open Catalan. I admit, I personally love the opening myself.

Often times names are assigned for a good reason, in the case of the Catalan, the fact that this queen's pawn opening, with `g3`, has a name for itself, is because the subsequent positions are very different than most sidelines of the queen's pawn with or without `g3`. That difference lies largely in the type of pawn structures that emerge from the Catalan. The Catalan, similar to the English opening, is very much about being conservative in the choice of pawn structure, i.e., not committing too early in the opening to a given pawn formation and keeping some options open so that ultimately, the optimal structure can be opted for purely reactively, given what black has decided to go for themselves.

Unlike the English opening in general, the Catalan, first of all, takes away the option of any early `e5` by black, as after all it's a `d4` opening, secondly and more importantly, it puts a special emphasis on the light square bishop, with the `g3` Fianchetto, providing a natural development square for it. This is very important, white will base most of its subsequent decisions on enabling that `g2` bishop as much as possible, whereas generally, in most queen's pawn variations, the light square bishop is **not** the central minor piece that gives a strategic direction in white's developing play, in fact there's a lot of conflict around where that bishop ought to be, `e2, d3, b5, b3,...`, and the conflict eventually gets resolved either purely reactively, or by another strategic decision not revolving mainly around the light square bishop (for instance, white may want to go for a certain pawn break or take away an important black piece, or cause a pawn structure damage, for instance taking the black knight on c6 when black can only recapture with the b pawn), which will decide the fate of our light square bishop. It is worth taking the time to think over this observation from a strategic point of view (start by comparing the bishop in the Catalan with the bishop in any other queen's pawn opening). A small takeaway here is, if in the Catalan, black managed to easily force a trade off of the `g2` bishop, something has probably gone wrong for white (even if slightly).

To close the loop of discussions and connect closely to your `c4` question: white primarily plays `c4` with the intention to challenge the long diagonal and extend the scope of the `g2` bishop, even at the cost of not being able to recapture the pawn. The justification is really in the same spirit as the queen's gambit, namely, if black chooses to accept the `c4` pawn, they will have permanently weakened the g2-b7 diagonal, and they will have to invest at least 2-3 tempi (`a6, c6, b5,...`) if they intend to keep the pawn (if not, it's easily recaptured via either `Qa4, Qc2, Na3, Nbd2,...`), and therein lies the compensation: white will have a huge advantage in development, which allows you to really lash out and attack black's structure from any angle you want, posing more and more problems to black and never allowing them to finish development properly, unless they accept some kind of setback. I'm so happy to see you are looking into Kramnik's games for insights into the Catalan, he really is the go-to player when it comes to fundamental understanding of positional openings like the Catalan. So without further ado, let's take some more of his examples. Below we have two different examples of black taking on `c4` and trying to hold on to it:

```
 [Title "Vladimir Kramnik vs Anish Giri 2014 (1-0)"]
 [fen ""]

 1.d4 d5 2.c4 c6 3.Nf3 Nf6 4.Nc3 e6 5.g3 dxc4 6.Bg2 b5 7.Ne5 a6 8.O-O Bb7 9.b3 cxb3 10.axb3 Be7 11.Bb2 O-O 12.Qc2 Nfd7 13.Nd3 Qb6 14.Ne4 a5 15.Ndc5 Bc8 16.Qc3 b4 17.Qe3 Na6 18.Rfc1 Nc7 19.Nxd7 Bxd7 20.Nc5 Be8 21.Ra2 Qb5 22.Qd3 Qxd3 23.Nxd3 Nd5 24.Ne5 Ra6 25.Bf1 Nc3 26.Bxc3 bxc3 27.Rxc3 c5 28.dxc5 Bf6 29.f4 Bb5 30.Bg2 Ra7 31.c6 Be7 32.Be4 f6 33.Nf3 Rd8 34.e3 e5 35.fxe5 fxe5 36.Rc1 a4 37.bxa4

```

Notice the position at exactly move 9, black lacks so much in development, ideally, once they've castled, they'd like to play moves like `Nbd7 Rc8 Qc7` and push `c5`. It's exemplary how Kramnik continues thereafter to exploit the weakened dark squares (irreversibly caused after black played `b5/a6` to protect `c4`) to pressurize `a5` and post a knight on `c5/e5`. By move 27, black has two isolated pawns both under attack by white's rook, and a knight dominating black's bishop pair, the rest is a matter of technical conversion (of the better activated and coordinated pieces). Another example:

```
 [Title "Vladimir Kramnik vs Alexander Morozevich 2007 (1-0)"]
 [fen ""]

 1.Nf3 Nf6 2.c4 e6 3.g3 d5 4.d4 dxc4 5.Bg2 a6 6.Ne5 Bb4+ 7.Nc3 Nd5 8.O-O O-O 9.Qc2 b5 10.Nxd5 exd5 11.b3 c6 12.e4 f6 13.exd5 fxe5 14.bxc4 exd4 15.dxc6 Be6 16.cxb5 d3 17.c7 Qd4 18.Qa4 Nd7 19.Be3 Qd6 20.Bxa8 Rxa8 21.Bf4 Qf8 22.b6 Ne5 23.Bxe5 Qf3 24.Qd1 Qe4 25.b7 Rf8 26.c8=Q Bd5 27.f3

```

In this game, the critical moment is really around move 11: notice that in principle we can say both sides have quite weakened their respective queen-sides (weakened dark squares, back pawns `a6, c6`,...), the key difference lies on the one hand, in the comparison of the `b4` bishop with the `g2` bishop. The latter is directly staring at black's weaknesses, the former is staring at the irrelevant `b4-e1` side-diagonal for the *rest* of the game. On the other hand, the story of the whole game: having provoked black into committing to a pawn structure, white has preserved options to challenge the structure in any way they want, and also to resolve their own weaknesses (as is typical for white to play `b3` and `a4`, resolving these pawns and precluding them from becoming targets to black). From move 10 onward, comes the "lash out" phase I was speaking about, pushing `b3, e4` and even sacrificing the knight!

Of course from the black side, there are a couple very different options in handling the Catalan, and by no means should the discussions above reflect that "the Catalan" is much better for white. Instead, it really comes down to style: Catalan is an extremely positional opening, where you want to get a quick development going, without having to trade off your minor pieces easily and without having to commit too early to a fixed pawn structure.
> 1 votes

---
Tags: opening, kramnik, catalan
---


# Question
Title: What's the verdict with Qa5 in the Accelerated Dragon?
After

```
[FEN ""]
1.e4 c5 2.Nf3 g6 3.d4 cxd4 4.Nxd4 Nc6 5.Nc3 Bg7 6.Be3 Nf6 7.Bc4 Qa5

```

Does White have to castle here? If so, what is wrong with 8...Qb4?

# Answer
In master level games (2400+ for both) 8. 0-0 is the only move.

White scores rather too well (34% wins) after 0-0, with black having 15% wins.

Including lower rated players white scores 38% wins vs 28% wins for black after 8.0-0. Thus this is very playable at lower levels.

Now about 8. ... Qb4 it appears dubious at higher levels but worth the shot in a regular game.

The sole high level game Solak (2566) vs. Djukic (2402) Serbian Ch 2007 proceeded as follows:

```
[FEN "rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1"]
[White "Solak, Dragan"]
[Black "Djukic, Zeljko"]
[Date "2007.08.29"]
[WhiteElo "2566"]
[BlackElo "2402"]

1. e4 c5 2. Nc3 g6 3. Nf3 Bg7 4. d4 cxd4 5. Nxd4 Nc6 6. Be3 Nf6 7. Bc4 Qa5 8.  O-O Qb4 9. Qe2 Ng4 10. Nd5 Qd6 11. Qxg4 Bxd4 12. Bxd4 Nxd4 13. Rad1 Qc5 14. e5  Ne6 15. b4 Qc6 16. Bb3 h5 17. Qh4 g5 18. Qe4 a5 19. a3 axb4 20. axb4 b5? 21.  Nf6!+ exf6 22. Bd5  1-0

```

and white converted his exchange, overall very uncomfortable game for black even without blunder.

Also 9. Bb3 seems good for white too as 9. ... Nxe4 appears bad:

```
[FEN "rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1"]
[White "Hofmann, Brigitte"]
[Black "Kratochvilova, Magdalena"]
[Date "1973.06.??"]

1. e4 c5 2. Nf3 Nc6 3. d4 cxd4 4. Nxd4 g6 5. Nc3 Bg7 6. Be3 Nf6 7. Bc4 Qa5 8.  O-O Qb4 9. Bb3 Nxe4 10. Nxc6 dxc6 11. a3 Nxc3 12. Qf3! Ne2+ 13. Kh1! Qh4 14.  Qxf7+ Kd8 15. Qxg7 Bh3 16. Qxh8+ Kc7 17. Qe5+ 1-0

```

Similar play proceeds after 10. .... bxc6

So if 9. .... Nxe4 is not playable then 8. ... Qb4 is questionable
> 3 votes

---
Tags: opening, accelerated-dragon
---


title: How to avoid Pirc in favor of KID

text:
# Question
Title: How to avoid Pirc in favor of KID
I like to play the King's Indian Defense (KID) and I know little to nothing about the Pirc. So, on 1.d4 I always go for 1. ... Nf6 but I don't know what to do to avoid 2.Nc3 g6 3.e4 d6 ending up in a Pirc. Do I have to change a move order somehow or there's simply no other way than studying how to tackle this Pirc position with black?

# Answer
> 9 votes
No, you cannot force white to play c4 and end up in a KID.

However, if you want to avoid the Pirc, you have several options after 1. d4 Nf6 2. Nc3.

* 2. ... d5 is the most popular and you usually end up in easy to play positions. E.g. you can fianchetto your bishop to g7, attack the center with c5, etc.. You need to be prepared for the Hübsch/Blackmar-Diemer Gambit after 3. e4, but that is nothing to be afraid of.
* 2. ... c5 to attack the center immediately
* 2. ... e6 which can transpose into the French defense

# Answer
> 4 votes
after 1.d4,Nf6 2.Nc3 one can use 2...d5. Since White cannot easily play c4, he cannot apply pressure on the d pawn (as in queen's gambit for example). As a result, Black has a very easy opening.

---
Tags: kings-indian, pirc-defense
---


title: How far from solving chess are we?

text:
# Question
Title: How far from solving chess are we?
See here: Does there exist an algorithm that would play perfect chess if given infinite processing power?

With infinite power, we could trivially recursively check every board state for winnability, and gradually work back towards knowing the winnability of the opening position.

At that point we would be able to definitely state whether perfect play leads to a White Victory, Black Victory, or Draw.

I don't know what the maximal tablebases currently are, but it seems like if you have a perfect tablebases for N-pieces, then exhasutively testing a single N+1 piece position shouldn't be *that* hard, and you would in the process also cross out a bunch of other N+1 positions. So the difficulty isn't specifically in evaluating positions at the next N, it's merely "there are a lot of those, and exponentially more of the next layer".

But we also have a LOT of brute-force computing power available.

How long would it take Google or Amazon to add another layer to our endgame tables, if they chose to?

How long would it take to just SOLVE chess, if humanity chose to?

# Answer
> 11 votes
Currently most of the 7-piece Lomonosov tablebases have been created. the only ones that weren't, were the K vs. K + 5 pieces. Those took about 6 months using the Lomonosov supercomputer.

Based on this answer, creating the 8-piece tablebases could take 100x the time it took to create the 7-piece, give or take an order of magnitude. Extrapolating, that would mean it could take 5/50/500 years, and probably on the lower end, 5-50 years for a supercomputer, and likely longer for Google or Amazon.

After a certain point, however, storage becomes a problem, as the number of game-tree possibilities surpasses the number of atoms in the universe. (see the Shannon Number)

# Answer
> 7 votes
Not only are we far from solving chess, in all likelihood chess will never be solved. There are more possible positions in chess than atoms in the known universe, so not only would in take forever (literally) to traverse the tree, but it would be impossible to store. At current cpu speeds, even with infinite storage, the universe would die of heat death before the computer could solve chess.

# Answer
> 5 votes
We are very very far from solving chess. We would need a 32 man tablebase for that. Currently, we have a 7 man tablebase. Each increase of 1 step, requires exponentially more computing power and storage space. Short of some incredible break-through in storage or computing power, solving chess is many many years in the future. I don't see it happening in this century. Your question reminds me of the old story about the peasant asking for 1 rice corn for the first square on the board, 2 for the next, 4 for the next, and 8, and so on. This illustrates nicely the problem of exponentiality. Try calculating the total weight of the rice the peasant was asking for!

---
Tags: tablebases
---


# Question
Title: Why doesn't FIDE recalculate ratings match after match?
In this question I brought up two rating systems and wondered which is used by FIDE.

Briefly, they are:

* **Method 1** Ratings are updated (recalculated in other words) after every match.
* **Method 2** Ratings are recalculated after a specific period of time, say after a tournament or once a month.

I found out that FIDE uses method 2 (recalculates ratings once a month).

### My question

*Why doesn't FIDE recalculate ratings after every match?*

Is there some kind of statistical problem with that? I don't mean to be partial to either method, but there must have been a compelling reason for FIDE to choose method 2 over method 1, and I'd like to know what that is.

I always thought recalculating the ratings match after match would make the system more accurate, but I'm not an expert, so I can't be sure.

# Answer
> 3 votes
I do not know what the true answer is but here are a couple of points.

The FIDE ratings started to be calculated sometimes in the 80's and published twice a year. This on its own explains why they were not calculated in real time (it just was not feasible with the technology at the time, well, it was feasible but too costly).

It is quite natural that FIDE did not want to change the system in place, they started publishing the ratings every month but otherwise kept the original system in place. One good reason for this is to keep what works well. Another good reason is the comparability of the ratings across time. If you changed the system to update the ratings in real time then the ratings before and after the change would not be exactly comparable (although the differences would very likely be negligible).

Recalculating the rating after every game is not necessarily more accurate. This depends on what your objective is. A player's performance in every single game depends on several factors like his skill (you can call it strength), his fitness perhaps, luck, etc. It depends which of the factors you actually want to measure. If it is the player's skill then that is a rather long term thing and it makes more sense to average the player's results over some period of time (or a number of games) to eliminate fluctuations that are purely due to luck. It is a non-trivial problem and does not have an obvious solution. I am almost certain that a perfect solution does not exist.

# Answer
> 6 votes
The ECF only update grades once every 6 months and their main reason is practicality. If they were to update grades after every game, it would require team captains and tournament organizers to submit game results immediatley after the game was played. In reality, results are only submitted a few days or weeks after the game, making instant grade updates difficult. With regional leagues it is even worse, with many leagues only submitting the entire grading period's result in bulk once at the end of the period.

I suspect Fide has a similar reasoning. Most Fide rated games are not between super grand masters in highly visible professional tournaments, but amongst amateur players on a club or school level relying on volunteers to make it work. It would be impractical to expect of these individuals to comply to a rigid regime of correctly submitting game results continuously - the number of mistakes and complaints would be enormous. By only updating grades monthly, they allow up to a month's leeway on results submission.

---
Tags: rating, elo, fide
---


title: Randomness in engine play

text:
# Question
Title: Randomness in engine play
If I get two engines to play against each other with the same colours, will the same game result every time? If not, where does the randomness in engine play come from? (Neglecting the opening book, where if I'm not mistaken the book can tell the engine to pick between two moves at random since they're equally good.)

I'm assuming that there is randomness because in the Alphazero vs. Stockfish match, we didn't get the same game happening many times in a row. However I don't understand why. Presumably the only way to do this is to get the engine to play a subpar move some of the time, which sounds like seppuku.

# Answer
Regarding the AlphaZero vs Stockfish match, this question has already been covered here by SmallChess.

AlphaZero aside (which employs a specialised Monte Carlo1 routine in its exploration of the lines of play), which is made to be non-deterministic by construction, for the usual heuristics based chess engines, such as Stockfish and others (though there are other engines that have MC-based routines, AFAIK Rybka used to have such feature), the source of randomness is generally just a consequence of technical aspects in the implementation, rather than intentional randomness being introduced algorithmically in the engine's decision making. Abstractly speaking, one reason for that is the fact that the engines aren't running in a purely sequential manner (executing one task after the other). Instead, to render the engines more efficient, they perform parallel searches in various branches of the tree of possible moves. They do so via what is called *multi-threading* (or *-processing* but that is a bit different). So multiple threads of the CPUs are *concurrently* executing operations to search the tree (and cache the evaluations of visited positions), so imagine each thread being assigned a subtree. The problem with this kind of implementation is that the overall execution of the threads becomes highly dependent on all sorts of conditions (waiting times, RAM swaps, ...), so in the end a principal variation may be chosen without having allowed all other threads to finish their search.

This indeed happens often because the engine is set to make a decision under a certain amount of time, so time management alters the behaviour. You can also revert this statement by saying: knowing the algorithm and implementing deterministic threading routines are not sufficient to reliably predict the state of the program after any time t. Of course if one always allows all threads to finish their search, and there haven't been concurrency issues during that execution (for instance a thread trying to access a certain cache that isn't accessible), then the behaviour will indeed be fully reproducible given everything else is the same2.

---

1: Together with the fact that through additional training (for instance self-play) its neural network keeps evolving (re-adjusted parameters), or if you will its evaluation function doesn't have a constant, fixed definition (unlike heuristics based engines).

2: Even then, as you said, at the opening level, with an opening book, there are sometimes intentional random decisions made by the engine as to which variation to choose. Similarly, outside of the opening phase, there can be moments where multiple variations have close to equal evaluations (within the resolution chosen for the Eval), then based on the design, it may end up choosing one randomly. Finally, at the level of engine settings you have to be careful as well, for instance the depth of search and ponder times chosen for each engine (and whether they can further calculate during each other's ponder times).
> 11 votes

# Answer
Thanks to @Phonon covering my previous answers in details. I'd like to add one more point: **time control**.

The only deterministic time control is by **number of nodes**, but this is uncommon. The much more common time control - **fixed number of seconds** or **game time** are generally not deterministic.

Let's try an example. Run stockfish on your terminal. Type:

> go movetime 20000

This command instructs the engine to make a move after 20 seconds. My results:

```
info depth 23 seldepth 32 multipv 1 score cp 6 upperbound nodes 24325860 nps 1216171 hashfull 999 tbhits 0 time 20002 pv g1f3 d7d5
bestmove g1f3 ponder d7d5

```

The move was 1.Nf3. Next, I killed my Stockfish, started a new one. Again, 20 seconds. I got:

```
info depth 23 seldepth 32 multipv 1 score cp 20 nodes 26185280 nps 1309067 hashfull 999 tbhits 0 time 20003 pv d2d4
bestmove d2d4 ponder g8f6

```

It's 1.d4! Same position, both 20 seconds search!

Do you see? Both 20 seconds for the move, but due to fluctuation in the Linux operating system my second run had deeper search (26185280 \> 24325860).

Please note this little experiment wasn't even multithreaded (number of threads = 1). Multithreading would make things even more non-deterministic.

Stockfish was given one minute per move in the Google AlphaZero match. Number of threads was 64. Stockfish's decisions in the match **couldn't** possibly be deterministic.
> 8 votes

---
Tags: engines
---


# Question
Title: Are online USCF tournaments worth playing?
I play a lot on ICC, and I notice they offer a few days of rated blitz and other time controls.

I'd like to play more rated games, however I'm afraid of how easy it is to cheat online. It seems like there is nothing stopping someone from having a laptop with them and making moves by running the game through stockfish. They could screw up just enough to evade "bot behavior" detection.

Are these types of games worth playing at all? Or should I just stick to going to the club once a week for classic games?

# Answer
First of all, the vast majority of people are not cheating. If they were, 1200 would be a master rating, and it's not.

Second, in a USCF rated game, you're not anonymous. The games are connected to your real name and your USCF membership. There might be some people willing to cheat anonymously who would be less willing if it could be traced back to them personally, and possibly put their offline membership at risk, rather than simply forcing them to make a new online account.

Third... yes, some people cheat. If you do play against Stockfish (with or without added mistakes) once or twice, so what? It won't be most of the time.

Fourth, if you're worried about cheaters affecting your rating, it appears that online play currently only affects your USCF "Blitz" rating, not your "Regular" USCF rating.

In summary: If you think it would otherwise be a good idea, there's no reason to let the prospect of cheaters dissuade you. (Although skipping club to play online would just be silly in most cases.)
> 3 votes

---
Tags: tournament, online-chess, uscf
---


# Question
Title: How the engine can detect the 3-fold repetition using FEN input?
When I run the engine (UCI interface), I usually feed the last position from the game using `position fen ...` command and get the best move back. The FEN encodes the possibility of the castlings, en passant moves and keeps the move count since the last piece capture or pawn move to enforce to 50-move draw rule.

How can the engine detect the 3-fold repetition and avoid it while playing the game? I've seen a few occasions when the engine is about 5-6 pawns ahead (a clear victory), but draws because it keeps repeating giving check to the opponent's king again and again.

Clarification: I DON'T program my own engine (well, I do, but this is totally unrelated to this question). In this question I use existing engine, think StockFish or Fruit or anything else you like. This existing engine is given the FEN and returns the "best" move it can think of. Sometimes this leads to a 3-fold repetition in a clearly won positions. How can I tell the StockFish, that it has already made this move before and should do better?

# Answer
> 5 votes
https://en.wikipedia.org/wiki/Forsyth%E2%80%93Edwards\_Notation

"FEN does not represent sufficient information to decide whether a draw by threefold repetition may be legally claimed or a draw offer may be accepted; for that, a different format such as Extended Position Description is needed."

QED.

---
Tags: engines, draw, fen
---


# Question
Title: If given infinite processing power, is there an algorithm that would play chess perfectly?
Does there exist such an algorithm where, if given infinite processing power, a computer could play chess perfectly, i.e., it can generate perfect moves from any position?

If so, where can I find the pseudo-code for it?

# Answer
> 67 votes
Does an algorithm exist? Yes. According to Zermelo's Theorem, there are three possibilities for a finite deterministic perfect-information two-player game such as chess: either the first player has a winning strategy, or the second player has a winning strategy, or either player can force a draw. We don't (yet) know which it is for chess. (Checkers, on the other hand, has been solved: either player can force a draw.)

Conceptually, the algorithm is quite simple: construct a complete game tree, analyze the leaf nodes (the game-ending positions), and either make the winning initial move, resign (if the opponent has a forced win), or offer a draw (if the position is a draw).

The problem lies in the details: there are approximately 1043 possible positions, and an even larger number of moves (most positions can be reached in more than one way). You really need your infinitely-powerful computer to take advantage of this, since a computer that can take advantage of this algorithm either can't fit in the known universe, or won't finish computation until sometime after the universe ends.

# Answer
> 26 votes
See https://en.wikipedia.org/wiki/Endgame\_tablebase.

With infinite computer power, one could build such a table for the starting position and solve chess.

In practice, only positions with up to seven "men" (pawns and pieces, counting the kings) have been solved using current supercomputers, so we are very far from solving chess. The complexity of the problem increases exponentially with the increase in the number of pieces.

# Answer
> 20 votes
If you really had *infinite* processing power, such an algorithm would be actually **trivial** to write. As chess has a finite number of possible states, you could in theory just iterate through them all until you find a path of perfect play. It would be horribly inefficient, but if you have *infinite* processing power, it wouldn't matter.

# Answer
> 13 votes
To directly address the question: yes there is such an algorithm. It is called minimax. (The endgame tablebases are generated by using this algorithm (backwards!), but the plain old simple minimax algorithm is all you need). This algorithm can play any two player zero sum game perfectly. Find pseudocode here:

https://en.wikipedia.org/wiki/Minimax

note that variants of this algorithm are used by modern computer chess programs.

This algorithm basically generates the move which will minimize the opponent's chances, i.e., it would choose a move for White that is +2 instead of +1. Then, it generates the opponent's move which will maximize his chances, i.e., it would choose a move for Black that is -2 instead of -1.

# Answer
> 5 votes
Not only is there an algorithm to play perfect chess, it is possible to write a short program that will (given infinite resources) play *any deterministic perfect-knowledge finite-duration two-player game* perfectly.

The game engine does not even need to know the rules of the game it is playing. All it needs is an opaque representation of a "game state" and functions that (a) given any game state, provide a list of legal next game states and (b) given a game state, decide if it is a win for player 1, a win for player 2, a draw, or it is not an end state.

Given those functions a simple recursive algorithm "solves" the game.

This fact has been alluded to in previous answers by chessprogrammer (minimax) and by Acccumulation (who provides a version of the program in python).

I wrote such a program over 20 years ago. I tested it by playing noughts-and-crosses (tic-tac-toe if you are American). Sure enough it played a perfect game.

Of course this will fall over quickly on any imaginable computer for any serious game. Because it is recursive it is effectively building the entire game tree on the stack, so you will get a "stack overflow" (pun very much intended) before you get anywhere near analysing the 10^123 states of chess referred to in other answers. But it is fun to know that in principle this small program would do the job.

For me this also says something interesting about AI: however much "intelligence" you think is exhibited by Deep Blue, or Go Zero, or indeed by a human playing Chess or Go there is a sense in which these games have trivial, exactly computable optimal solutions. The challenge is how to get a good though not optimal solution in a reasonable time.

# Answer
> 3 votes
I will ignore the possibilities of draws or infinite sequences of moves for simplicity. Once the algorithm is understood, it is not particularly difficult to extend it to those cases.

First, some definitions:

1. Any move that wins the game for the player who makes that move is a winning move.
2. Any move that loses the game for the player who makes that move is a losing move.
3. Any move that leaves the other player with at least one winning move is also a losing move. (Since the opponent can take that move and force a loss.)
4. Any move that leaves the other player with only losing moves is also a winning move. (No matter what move your opponent makes, you will win.)
5. A perfect strategy means always making winning moves if any remain and resigning when one has only losing moves remaining.

Now, it's trivial to write a perfect strategy. Simply explode all possible move sequences and identify winning/losing moves. Ignoring stalemate, this will eventually identify every move as either a winning move or a losing move.

Now, the strategy is trivial. Look at all your possible moves. If any winning moves remain, take one and win. If only losing moves remain, resign, since your opponent can force you to lose.

It is not difficult to adjust the strategy to include the possibility of a stalemate.

**Update**: Just in case it's not clear how this identifies every move as a winning more or a losing move, consider:

1. Every move that results in a win is a winning move.
2. Every move that results in a loss is a losing move.
3. Every move that results in the opponent having only winning or losing moves is either a winning or a losing move.
4. Call `n` the number of moves in the longest possible chess game. (We are ignoring unbounded sequences for now, though including them is not difficult.)
5. There are no moves with `n` prior moves we need to consider.
6. Every move with `n-1` prior moves is either a winning move or a losing move since `n` moves ends the longest game.
7. Thus every move at depth `n-2` is followed by only winning moves or losing moves and thus is itself a winning move or losing move.
8. And so on back to the first move.

# Answer
> 3 votes
Suppose you have three functions: `win_state` , `get_player`, and `next_states`. The input for `win_state` is a game state, and the output is -1 if white is in checkmate, 0 if it’s a draw, 1 if black is in checkmate, and `None` otherwise. The input for `get_player` is a game state, and the output is -1 if it’s black’s turn and 1 if it’s white’s turn. The input for `next_states` is a list of possible next game states that can result from a legal move. Then the following function, when given a game state and a player, should tell you what game state to move to for that player to win.

```
def best_state(game_state,player)
  def best_result(game_state):
     if win_state(game_state):
        return(win_state)
     else:
         player = get_player(game_state)
         return max([best_result(move)*player for move in next_states(game_state)])*player
  cur_best_move = next_states(games_state)[0]
  cur_best_outcome = -1
  for state in next_states(game_state):
     if best_result(state)*player > cur_best_outcome:
           cur_best_outcome = best_result(state)*player
           cur_best_move = state
return(best_move)

```

# Answer
> 1 votes
## Use a look-up table

Yes. It's easy. You don't even need infinite processing power. All you need is a look-up table that contains, for each possible board position, the best move to play in that position. Here is the pseudo-code:

```
def play-move(my-color, board-position):
    return table-of-best-moves[my-color, board-position]

```

## The catch

The only catch is that this look-up table would have to be very, very large—perhaps larger than the Milky Way galaxy—and it would take a long time to construct it—perhaps longer than the current age of the universe, unless there's some undiscovered regularity in chess that makes it much simpler than we can see right now. But if you had this look-up table, the subroutine to choose a perfect move every time could be implemented in as little as one CPU instruction.

Also, given our current knowledge of chess, there's no way to be sure that perfect play guarantees that you won't lose. For example, if perfect play guarantees a win for White, then Black would lose even if Black plays perfectly.

---
Tags: chess-algorithms
---


title: A purely self-trained chess AI

text:
# Question
Title: A purely self-trained chess AI
Insofar as I understand, it appears that, before moving, all strong chess software

1. examines thousands or millions of possible, future positions;
2. evaluates each future position according to some heuristic, called an *evaluation function;*
3. separately evaluates each future position for *quiescence,* to decide whether to explore continuations from the position;
4. chooses from among available moves by *minimax;* and
5. uses an *opening book.*

So far, so good. However, the strength of a chess program seems mostly to depend on the quality of its evaluation and quiescence heuristics -- and also on its opening book which, from the computer's perspective, is yet another heuristic. Such a chess program apparently, only, exactly knows as much about the game as does the human who has crafted the heuristics. The program seems to have no insights of its own.

Has anyone ever written a chess program that does have insights of its own? That learns the game on its own? That trains itself? Such a program would be provided with the rules of the game, of course, and would presumably further be provided with raw minimax and quiescence infrastructure, and would be able to recognize and prosecute a forced mate if it found one. However, it would be provided no heuristics. For example, it would not be told to open the game toward the center, nor to prefer rooks to knights, nor what is the Sicilian defense. It would have to infer such principles (or, conceivably, to discover better principles) on its own.

In its pure form, such a program would never be provided master games to study, but only its own games, played against itself. Only once fully self-trained would it be unleashed on human competition.

Does such a pure chess AI exist? Has a mechanical chess autodidact ever appeared? Indeed, can the old Turk teach himself?

Here seems to be a brief notice of a pure chess AI that failed.

(A tangentially related question has earlier appeared on this site, regarding the computerized study of chess openings.)

**UPDATE**

The question is graced by three different, illuminating answers at the time of this writing, by @WesFreeman, @GregE. and @Landei. All three are strongly recommended and I am going to feel guilty when, according to site policy, I formally *accept* one to the exclusion of the others. Let me here give thanks for and express my appreciation of all three.

Questions want brevity. A response to answers however might run longer. The interested reader therefore can skip from here directly to the answers and then, if still interested, can return to read the longer update that follows.

When I asked the question, I had in mind something like the following.

Suppose a hypothetical village on the outskirts of Shangri-La where the people have never heard of chess. During your brief visit, you teach the village elders the rules of the game, but never instruct them in any of the game's principles. Two of the elders play a game as the rest of the elders watch, while you (not wishing to disrupt the play by kibitzing) confine your commentary to questions of the rules. No postmortem follows the game, nor is chess played or discussed again while you are remain in Shangri-La. However, when you depart, never to return, you leave your chess set behind.

In your absence, the elders teach the game to the people. Some of the people later play a little during leisure hours, a few with growing enthusiasm, who fashion chess sets of their own.

It might not immediately be obvious to such villagers that a rook were better than a knight, but the people might still gradually work out the relative strengths of the chessmen over the play of many games. Likewise, it might not immediately be obvious to them that 1. a4 were a poor opening: they could but try it and consider the results.

To what extent would the villagers' understanding of the game eventually converge to that of the outside world? Lacking an opening book, might they develop novel openings of their own? Of course, one would not expect the villagers' openings to be very good at first but, given a couple of centuries of isolation, the villagers *might* develop a respectable opening repertoire, for all I know.

Would any of their openings, independently developed, prove interesting to the outside world, when the next traveler passed through to take note of them, 200 years later? Might Shangri-La give the world the new, novel, Shangri-La Defense?

If so, then, with respect to my original question on chess AI, what I had in mind was more or less this: could a chess AI more or less duplicate the chess progress of the villagers on the outskirts of Shanrgi-La?

Considering Sussman's story in @Landei's answer below, it is undoubtedly true that my villagers would bring certain preconceptions to the game. For example, they would bring an understanding that to possess more of a useful thing were generally better than to possess less of it, and therefore that to capture an opponent's chessmen were probably, usually preferable to suffering the capture of one's own. How territorial the fictional people of Shangri-La were by nature is a question for literature, but one can assume that they would recognize a position that commanded more space as superior to a position that commanded less. And any bright novice, once shown a chess set and instructed in the game's rules, can infer that a queen is likely better than a pawn, simply by that the queen has up to 27 moves available, whereas the pawn has no more than four -- and moreover, by speculative inference against the game's design, by the observation that a player begins with fewer queens than pawns.

My question therefore need not be construed to imply an absolute, Sussman-style injunction against bringing any kind of knowledge whatsoever to the chess board; but rather to imply a general injunction against preconceived, chess-specific knowledge. After all (disregarding the matter of the evolution of the game's rules long ago), at some time in the past, the first game of chess was played. Maybe the first player did open 1. a4; but eventually he learned better, and taught what he had learned to his disciples; who in turn learned more and taught more, generation by generation, to give us Kasparov.

Could an AI not do something like that, only in weeks rather than centuries?

Plato would be skeptical, I suppose. Hume would be more optimistic, but the question is no longer to be settled by philosophy alone. We have electronic computers now with which to test the proposition, and I was wondering what the state of the AI art was. The best chess AIs at present seem to be thoroughly unintelligent expert systems that beat everybody while intuiting nothing. I wondered whether slightly broader AIs that, in some sense, actually think about chess, had had any considerable success at teaching themselves the game.

I gather that the answer is no, probably not.

# Answer
> 32 votes
You have some very interesting points. I have a bit of experience in AI research (my M.Sc. was in this field), so I think I can provide some insights.

**Reasearch in the area**

First, research in this field is certainly happening - searching for "evolutionary approach chess" came back with this paper from 2001, doing pretty much exactly what you suggested, leaving the min/max approach and only modifying the evaluation function. It's possible to dig up many more, and I'm aware of several people who were working in this field in general.

**Theoretical possibilities**

In my opinion, the only real limiting factor for the creation of a "pure" chess playing AI is computation time. There is absolutely no reason why such an AI cannot theoretically be created using current approaches.

**Practicalities**

There are two main problems with using evolutionary or genetic approaches in evolving a chess heuristic function, the first is that even at its most basic, a heuristic function for chess is *hugely* complex. We're talking hundreds of rules, piece valuations (which may differ based on position, etc), positional analyses, etc. You'd need a flexible computer language in which to describe these rules, and then these rules could be randomly generated, mutated, bred with each other, etc. It's certainly possible, but I'm guessing you'd end up with a rule set that is comprised of several thousand entities. That's a very large rule set to evolve dynamically.

The second problem is that to actually evaluate your newly modified rule, you have to play games of chess, and see who ends up winning. If you want to do this "correctly", you will want to give both players plenty of time to think, something similar to a typical game length. However, playing only a single opponent is not enough, you'd want to play many different opponents, and perhaps even the same opponents, many times, before you can truly be convinced that you have found an improvement in game strength. This would probably mean playing a couple of hundred games per individual in your population, and that gives you one generation of your algorithm.

Typically with these types of approaches, you'd be looking at least several hundred generations, or with such complex functions as a chess heuristic, several hundred thousand (or even millions of) generations. Some quick maths should convince you that you'd need several thousand hours of CPU time for a single generation, even scaling this out a server farm of significant size, you will probably need several (possibly hundreds) of years to actually evolve, exactly as you mention in your update.

At the end of that time, you'd have an interesting algorithm which would probably have tons of insights into the game which have never really been discovered. It's difficult to tell whether they'd be useful or even understandable to humans. Why does *this* rule exist? Because over several thousand games, it seemed to work.

**Future**

I have no doubt that these approaches will gain more an more popularity, as computing power increases. Currently, we're at a point where a machine has just enough computing time to beat (almost all) humans, if it's intelligence is carefully hand-crafted. In 20 years' time, it's quite possible that processors will have moved on so much that one or two extra moves in depth no longer give the "hard-coded" machines enough benefits, but are routinely beaten by evolved, strangely intuitive machines which have millions of hours of evolution behind them.

**Update 2018 May**

As Robert Kaucher mentions in a comment below, recent news deserves a mention here. Specifically, Google's AlphaGo project seems to be the first truly viable AI-based approach to these types of games, and in late 2017, claims to have won against StockFish , after being re-purposed for the task.

# Answer
> 23 votes
It's worth revisiting this question in light of the recent striking success of AlphaZero against Stockfish 8. A further evolution of DeepMind's AlphaGo and AlphaGo Zero programs, AlphaZero finished with a staggering score of +28 =72 -0 against one of the strongest "traditional" chess engines on the planet.

AlphaZero taught itself to play through reinforcement learning, training its neural network architecture through series of games against itself. According to the accompanying paper:

> 1. The input features describing the position, and the output features describing the move, are structured as a set of planes; i.e. the neural network architecture is matched to the grid-structure of the board.
> 2. AlphaZero is provided with perfect knowledge of the game rules. These are used during MCTS, to simulate the positions resulting from a sequence of moves, to determine game termination, and to score any simulations that reach a terminal state.
> 3. Knowledge of the rules is also used to encode the input planes (i.e. castling, repetition, no-progress) and output planes (how pieces move, promotions, and piece drops in shogi).
> 4. The typical number of legal moves is used to scale the exploration noise (see below).
> 5. Chess and shogi games exceeding a maximum number of steps (determined by typical game length) were terminated and assigned a drawn outcome; Go games were terminated and scored with Tromp-Taylor rules, similarly to previous work (29).
>
> **AlphaZero did not use any form of domain knowledge beyond the points listed above.**

I'm sure one can raise questions about things like the differing hardware being used -- "*AlphaZero* ... used a single machine with 4 TPUs. *Stockfish* ... played at \[its\] strongest skill level using 64 threads and a hash size of 1GB." -- but in any case AlphaZero's result is a remarkable one, and very much in the vein of the OP.

Revealing perhaps even more support for how little domain-specific knowledge was at play, in addition to beating Stockfish in chess, AlphaZero also trained at shogi to the point of besting the champion program Elmo, and of course also surpassed its predecessor AlphaGo Zero in Go.

Here's one of the games against Stockfish, a Berlin in which the material imbalance is eventually AlphaZero with the bishop pair against a knight and 4 pawns for Stockfish after `31.Qxc7`. In that position, all of AlphaZero's pieces are on the back rank, with the bishops back on their original squares. Ultimately, after the queens come off the black pieces slowly maneuver to pick up white pawns, and that's curtains.

```
[fen ""]
[Date "2017.12.04"]
[White "Stockfish"]
[Black "AlphaZero"]
[Result "0-1"]

1.e4 e5 2.Nf3 Nc6 3.Bb5 Nf6 4.d3 Bc5 5.Bxc6 dxc6 6.O-O Nd7 7.Nbd2 O-O 8.
Qe1 f6 9.Nc4 Rf7 10.a4 Bf8 11.Kh1 Nc5 12.a5 Ne6 13.Ncxe5 fxe5 14.Nxe5 Rf6
15.Ng4 Rf7 16.Ne5 Re7 17.a6 c5 18.f4 Qe8 19.axb7 Bxb7 20.Qa5 Nd4 21.Qc3
Re6 22.Be3 Rb6 23.Nc4 Rb4 24.b3 a5 25.Rxa5 Rxa5 26.Nxa5 Ba6 27.Bxd4 Rxd4
28.Nc4 Rd8 29.g3 h6 30.Qa5 Bc8 31.Qxc7 Bh3 32.Rg1 Rd7 33.Qe5 Qxe5 34.Nxe5
Ra7 35.Nc4 g5 36.Rc1 Bg7 37.Ne5 Ra8 38.Nf3 Bb2 39.Rb1 Bc3 40.Ng1 Bd7 41.
Ne2 Bd2 42.Rd1 Be3 43.Kg2 Bg4 44.Re1 Bd2 45.Rf1 Ra2 46.h3 Bxe2 47.Rf2 Bxf4
48.Rxe2 Be5 49.Rf2 Kg7 50.g4 Bd4 51.Re2 Kf6 52.e5+ Bxe5 53.Kf3 Ra1 54.Rf2
Re1 55.Kg2+ Bf4 56.c3 Rc1 57.d4 Rxc3 58.dxc5 Rxc5 59.b4 Rc3 60.h4 Ke5 61.
hxg5 hxg5 62.Re2+ Kf6 63.Kf2 Be5 64.Ra2 Rc4 65.Ra6+ Ke7 66.Ra5 Ke6 67.Ra6+
Bd6 0-1

```

# Answer
> 18 votes
I suspect that what you're asking about would be classified as some sort of genetic algorithm or evolutionary algorithm approach. I suspect there's no realistic way of designing such an algorithm without intrinsically embedding some degree of human bias at a fundamental level, since the programmer still has to define the static features of a position (material count, pawn structure, color complexes, etc.) according to which the AI would classify and compare positions from different games. If you do a Google search on the above algorithmic terminology in the context of chess, you'll find numerous results, but probably little in the way of serious research that has actually been used to build successful, competitive AIs.

The fact is that, as a consequence of Moore's law, computers are now such powerful calculating machines that extremely sophisticated AI methods are not only unnecessary (in terms of playing at a level higher than the best human opponents), but can even conceivably be counter-productive. Chess is the kind of game in which -- due mainly to its comparatively small search space of reasonable moves in any given position and the existence of forcing tactical combinations (comprising sequences of checks, piece captures, threats of mate or catastrophic loss of material, etc.) -- a brute-force approach with some conservative search-tree pruning is simultaneously the most algorithmically simple and the most effective approach. If you factor in the availability of endgame tables and opening books, the logic of that approach only grows. I understand that there's a still a great deal of theoretical interest and potential value in the sort of novel AI that you're talking about, but I suspect chess is the wrong arena in which to develop it. On the other hand, a game like Go, which is less tactical by nature and encompasses a vastly larger search space that renders brute-force approaches impractical, might be a better candidate for cutting-edge AI research.

# Answer
> 15 votes
See Wikipedia's page on General Game Playing. It's an active research area. There is an annual GGP tournament in which programs are given the rules of a new game, get to think about it for a while, and then play the game against each other.

If you give the rules of chess to a GGP program, I think you'll find that it plays much stronger than a human beginner and much weaker than a purpose-written chess program.

# Answer
> 11 votes
I think the main reason it's difficult to produce such an AI is because of the space required in storing the "training" to be effective.

Also (as a response to your self-training comment), self training can be detrimental while trying to improve such an AI--I've done some research with tic-tac-toe (admittedly much simpler), and it found all sorts of horrible ways to win (and train those horrible ways) because both sides played horribly. It took much much longer to get reasonable performance with self-training than training against a good look-ahead AI in tic-tac-toe.

However, I think it would be interesting to see a hybrid that uses both deep search and "training"--some sort of stored database of positions for middlegame (instead of just endgame and openings). It would need a lot of space.

Maybe you're thinking of a more "real" AI approach that would learn positional concepts rather than position win/loss/draw, but I don't think that would be very effective (compared to strong engines).

# Answer
> 11 votes
Please meditate about the following AI Koan:

> In the days when Sussman was a novice, Minsky once came to him as he sat hacking at the PDP-6. “What are you doing?”, asked Minsky. “I am training a randomly wired neural net to play Tic-Tac-Toe” Sussman replied. “Why is the net wired randomly?”, asked Minsky. “I do not want it to have any preconceptions of how to play”, Sussman said. Minsky then shut his eyes. “Why do you close your eyes?”, Sussman asked his teacher. “So that the room will be empty.” At that moment, Sussman was enlightened.

Our applications have always preconceptions, whether or not you close your eyes...

# Answer
> 10 votes
I just want to expand on Greg's and Wes' answers here. The sort of AIs that thb is proposing simply do not exist with the sophistication that is required for this application. And even if they did, I suspect they would fail at this. It's as if thb wants a strong general purpose AI that can be taught the basic rules of the game and then be sent forth. But if you look at the general purpose AIs that are in development they are all being taught things like object and speech recognition at a 1 to 2 year old's level. Any general purpose AI would first need to have the sophistication to be able to understand what a game even is before it could understand how to play a game. You cannot design a general purpose AI and expect it to perform like a narrow or specialized AI. A general purpose AI would need to be taught chess like a person and you cannot expect to put two novice players with no knowledge of chess history together and spontaneously reinvent openings and strategic themes. It would take many hundreds of instances of the AI playing each other, each with access to the historical data of all of their games over many hundreds of thousands of iterations. And each AI would need to have certain distinct characteristics weighted at different levels.

It took humans nearly 500 years to get from Rodrigo (Ruy) López de Segura and Pedro Damião to Paul Morphy and then consider the further changes that occured between the play of Steinitz and Alekhine. And all of that change occurred through the dynamism of many hundreds of thousands of players with different temperaments and other influencing characteristics (such as randomly favoring knights over bishops or bishops over knights) not to mention playing styles and fashions. All of these things contributed to the dynamo of change that influenced chess through the centuries. No weak AI - even a weak general purpose AI- could duplicate that sort of dynamo because it lacks desire. Only desire can drive something to sit for hours over many days to analyze an opening with the ***intention*** of busting it or improving it after a rival "busted" it. Really it's this sort of drive for analysis and preparation that improved play over the centuries - not blind play of million of games between equally weak players.

It's like taking a bunch of people who do not speak English and who never read their native tongue's masters of literature and putting them into a room with English as a Second Language books and expecting them to come up with something like the works of Shakespeare. It's never, ever going to happen.

**EDIT**: I should have known better than to make this claim because it has happened.

> “AlphaZero was not ‘taught’ the game in the traditional sense,” explains Chess.com. “That means no opening book, no endgame tables, and apparently no complicated algorithms dissecting minute differences between center pawns and side pawns. This would be akin to a robot being given access to thousands of metal bits and parts, but no knowledge of a combustion engine, then it experiments numerous times with every combination possible until it builds a Ferrari. … The program had four hours to play itself many, many times, thereby becoming its own teacher.”

My continued, obviously baseless blathering:

We take for granted all of the implicit knowledge that we have about the world. In order to be able to understand that if I have to pieces of wood and a nail, then a hammer is more useful to me than a screwdriver I have to first understand that certain classes of things are more useful in certain situations than other things. I also have to understand that things have a use that can be applied to a goal. These are heuristics. If the AI cannot be told that certain pieces have more value than others, how can it even understand what mate is? If it cannot be programmed with specific heuristics, it must be able to extrapolate these ideas like "value" and "utility" form experience. And that is not the domain of narrow AI. It's the domain of general purpose, strong AI.

# Answer
> 9 votes
> Has anyone ever written a chess program that does have insights of its own? That learns the game on its own? That trains itself?

Yes. Check out the Giraffe chess engine written by Matthew Lai. He wrote the chess engine as part of his Artificial Intelligence research for a masters degree in computer science.

There was a lot of discussion about this last year on the TalkChess chess programming forum. I know because I am a chess engine author whose engine is roughly as strong as Giraffe. However, I implemented my engine using traditional techniques whereas the author of Giraffe trained his engine using "temporal-difference reinforcement learning with deep neural networks." Matthew still had to implement traditional alpha / beta search to *dynamically* evaluate a position- in other words, to look ahead many moves. His innovation is in training the engine to evaluate a *static* position. In comparison, I wrote specific knowledge into my engine's static evaluation routine.

I wrote code to tune evaluation parameters using a particle swarm algorithm (see Thank You page on my blog for links to technical discussion) that did yield positive results- a stronger engine. However, this wasn't a task of getting the engine to "learn" so much as minimizing error in an extremely large space of evaluation parameters (the order of 10 ^ 150 discrete parameter combinations).

Matthew discusses his dissertation on the TalkChess forum. He works for Google on DeepMind now, if I remember correctly.

Also, check out Thomas Petzke's blog. He has written an extremely strong chess engine, iCE, and used genetic algorithms to improve the engine's static evaluation. See his posts from 2013 and earlier, such as Population Based Incremental Learning.

# Answer
> 5 votes
A Google search like this can turn up results like this.

Most particularly, I believe you will want to look at this paper. They do give their engine some initial data such as piece values, so it's not exactly what you're asking for, but it performed quite well.

# Answer
> 3 votes
It's possible with machine learning.

Opening books of chess engines use machine learning. Engine *tests* opening lines in the book by playing them, if a line scores better comparing another, then it promotes that line in the opening tree. In time, engine *learns* the better lines.

After opening phase ends, engine stops using the book, and starts using evaluation function.

---

**How to implement a self learning engine using machine learning?**

Imagine an engine using a *book* without an evaluation function. And the book is empty initially. So engine has no knowledge about chess.

Engine starts to play with this empty book, and doesn't close the book until the end of the game. We can think it like a regular engine which uses an opening book till the end of the game.

In time, engine would find best continuations statistically, as bad lines will score worse in time. But of course, *a lot* of games should be played to obtain a good book. I don't know how many, but as many as we can say impractical.

**December 2017 Update**: Well, I guess Alpha Zero proved me wrong by training itself strongly enough to beat one of the strongest engines, Stockfish, with a *practical* amount of games.

# Answer
> 2 votes
Whatever you try in this area, be sure to read first Turry's story here: http://waitbutwhy.com/2015/01/artificial-intelligence-revolution-2.html

TL; DR; *spoiler version* per request:

> In Turry's story Turry's self-training AI has to write nice handwritten notes and end ups getting rid of humans because they are not needed to achieve the apparently innocuous goal of writing nice handwritten notes. The analogy is that a self-trained chess engine with AI most likely will also get rid of humans because they are not needed to improve the apparently innocuous goal of improving chess skills.

# Answer
> 2 votes
And there is AlphaZero. Celebrate a whole new generation of chess engines

# Answer
> 0 votes
> The use of anthropomorphic terminology when dealing with computing systems is a symptom of professional immaturity

From How do we tell truths that might hurt? by Edsger W.Dijkstra pretty much sums up the mistaken assumption underlying your question. Artificial Intelligence may be artificial but it is not intelligence in the human sense.

In the 1984 Reith Lectures for the BBC the American philosopher John Searle explains exactly what is wrong with hard AI. The "too long, didn't listen" summary of his argument is "Syntax is not semantics" but I would nevertheless encourage you to at least listen to lecture 2 "Beer Cans & Meat Machines".

Once you've grasped what Dijkstra and Searle were saying more than 30 years ago you will recognize what is wrong with your questions:

> Has anyone ever written a chess program that does have insights of its own? That learns the game on its own?

Human beings have "insights" and can learn. Computers can not. Your village of primitive humans could over the centuries reproduce chess opening theory but computers not.

# Answer
> 0 votes
This answer is given by the asker of the original question, four years after the question. It does not substitute for or supersede answers earlier given, for most of the earlier answers are more interesting than this one is. However, this answer might add some additional context.

As far as I can tell, most AI research seems implicitly to grant the premise that thought and reason were solely material phenomena, or at least that results indistinguishable from thought and reason must necessarily be achievable by solely material processes. I do not dispute the premise (nor here promote it, for that matter). I merely observe that it seems *to be* a premise.

And, after all, in AI research, how should this not be a premise? AI researchers must work through material processes, whether they will or nill.

The schoolmen of realist philosophy, back through Duns Scotus, St. Thomas, Aristotle and Plato, have had much to say regarding the theory of mind. Representationalists like Kant have had rather different things to say. AI research is probably closer to Kant, but this does not make the schoolmen wrong.

Admittedly, there is a God-of-the-gaps objection which tends to pop up at this point in conversations of the present kind, yet a professional philosopher would tell you that the God-of-the-gaps objection attacks a straw man, that this objection tends to be useful only against persons who have studied no philosophy and thus do not know what they are talking about. Per Aristotle, it is *formal* and *final causation* which might be implicated in the question of the self-trained chess AI. Yet in Aristotlean terms, the AI researcher works purely with *material* and, especially, *efficient causation* (except perhaps obliquely, insofar as human trainers personally bring formal and final elements into the system). If reason is formal, if thought is final, if Searle's Chinese room proves to be an ontological impossibility (as it might), then it may be that a purely self-trained chess AI cannot even in theory be achieved.

I suspect that a purely self-trained chess AI can be indeed be achieved, and will be—that, in Aristotlean terms, *this* question will prove to be adequately framable in view of merely efficient causation. I am more skeptical of strong AI generally, but these are to be proved in experience, are they not? No one really yet knows.

The philosophy of causation and mind is subtle, grasped by few (and probably by few, even among AI researchers, who are more practical men). If you wish to learn such philosophy, it is well worth the learning; but be advised that, on the Internet and even often in print, it is extremely easy to find misleading explanations based on untutored misunderstandings. For my money, the best introductory teacher writing today on the subject is Edward Feser, whose books remain in print at reasonable prices. You can learn much more from him.

However, one doubts that even Dr. Feser would venture an authoritative answer on the present question! The answer remains to be proved in the laboratories of AI.

# Answer
> -5 votes
I want them to release the code, then we can talk. It is not that easy to solve chess, Alpha will not solve it even in half a century. Funnily, it still plays 1.d4. Why? Because it has been trained on human games and human theory gives highest performance rate for 1.d4. The poor thing does not know 1...c5 achieves a draw in precisely 8 moves. Now they want me to believe Alpha did not use a simulated opening book... They say Alpha played openings great. Well, yes, with some exceptions. 1.d4 certainly does not speak well of the level of intelligence the program attained. Luckily, SF is even weaker in the opening stage. :)

---
Tags: engines
---


title: How to analyse an endgame quickly?

text:
# Question
Title: How to analyse an endgame quickly?
I am a relatively new player (less than 1 year, ungraded) but I feel I have made good progress so far. I am playing competitively with players in the 1300-1500 region and would like to continue my improvement.

Middle game is my strong point for sure, I am able to muddle through some common openings and get into a complex middle game quickly, as that is where I am strongest. But I can't get over the hurdle that more experienced players seem to be able to instinctively recognise if an endgame is won, drawn or lost.

I want to spend my efforts in understanding common endgame patterns and how to handle them. Here is an example of a position I found myself in recently as white. My opponent felt it was a draw but it took me a long time to agree.

```
[FEN "8/5kp1/5p1p/4p3/nB1pP3/1b1P1P1P/5KP1/2N5 b - - 0 1"]

```

## My question

Other than simply playing more games and gaining more experience, are there any patterns I should be looking for in an endgame such as the example given, so I can more easily determine if a position is won/drawn/lost?

Note: I see a number of similar questions being asked, and the general responses tend to be "practice more, here's a book/website of endgame positions for you to analyse". I'm looking more specifically for people who can explain endgames in a bit more detail, I'm not afraid of a bit of maths.

# Answer
## Introduction (if tldr; skip to analysis)

I'm afraid there isn't really a simple answer to this, though it's a very sound question to ask as endgames really are different than the other phases of the game. The main reason for this is that endgames tend to be extremely concrete, meaning principled approaches to them are not always guaranteed to work. For examples, a principle one is often told about is to keep your pawns on squares of opposite color to your bishop, as to not hinder the scope of your bishop's activity. That sounds reasonable of course, but whether it's really a good idea or not will depend on the *context* and on all the intricate details of the position at hand, namely, how advanced and scattered the pawns are, the relative position of the kings, interplay of minor pieces, rook activity, number of targets in the position, and so on. This is to say that, sure there are endless principles to learn about endgames, but they're always to be taken with caution.

One may ask why this is so specific to endgames, at least more so than other phases of the game, intuitively, that's because naturally in endgames there will be less pieces, therefore less ways to create play or compensate for small mistakes (in contrast to the middle-game, where e.g., there are usually enough pieces to parry weakened squares, or to create play elsewhere as to divert attention away from the weakened side). As a result, one small mistake in the endgame may either ruin your advantage or even cost you the game. So one has to resort more often to sheer calculation rather than intuition or feeling. This is also why even at the highest level, one regularly sees players ruining their endgames or admitting afterwards that they had no clue how to assess the position.

## Analysing your example

For example the position you've given, it's a NB-vs-NB. Had there been simply the bishops, it would be very clear why it's drawish, because of opposite colored bishops (a principle that is generally true). But the addition of knights makes it very complex, because now the interplay of these minor pieces is very different: first observation to make is whether the bishops are equally enabled to zone out the opponent's knight. You notice black's bishop has completely cut your knight out of play, and any chance of re-routing the knight, say via `e2-g3-f5` will be met with `g6.` On the other hand, black has placed all their pawns on dark squares, so the king is bound to defending them against your bishop, starting from the `g7` back-pawn. The weakness on `d3` really breaks the symmetry though, as black has no equivalent weakness. But that's not enough (at least at first glance) as black has no clear means of increasing pressure on it, or creating a zugzwang situation by exploiting it as all of black's bishop entry points to your king-side are covered by your king. More precisely, `Bd1` will be met by `Ke1` and `Bc2` by `Ke2.` So that doesn't work. What instead looks more worrisome is the knight potentially penentrating your fortress and getting behind your pawns. For example, an immediate `Bc2` followed by `Nb2` to `d1.` Because a priori you don't really want to let the knight to get to `e3,` even if it's still holdable, it looks hell scary to allow. So we need to come up with something to prevent all this. If you don't find an active idea and sit still it's going to be very hard (even a bad plan will be better than no plan at all). Luckily, here it's still rather simple as there's no dilemma of choice, basically all you can do is to try and undermine black's pawn chain, in order to create a weakness and balance things up again. So let's look at a possible variation (comments added):

```
 [Title "Bc2 Nb2 variation"]
 [fen "8/5kp1/5p1p/4p3/nB1pP3/1b1P1P1P/5KP1/2N5 b - - 0 1"]

 1...Bc2 2.Ke2 {Ba3 is possible of course, but then you allow Nc3 and that's another variation altogether, as you need to account for the king marching to g3} Nb2 3.Kd2 Ba4 4.Ne2 {preparing f4 to undermine the pawn chain by creating a weak spot on e5 after takes takes, just a tad safer than the immediate f4, though it may be possible} Nd1 5.f4 Nf2 {Ne3 is less attractive as Ne2 covers g3. So Nf2 is the only sensible choice, threatening Bb5 } (5...Ne3 6.g3 {and Nc1+ does nothing}) 6.fxe5 fxe5 7.Bd6 {You see f4 has made all the difference, our bishop is suddenly creating play} Ke6 8.Bf8 Bb5 {if Kf7 you can repeat} 9.Bxg7 Nxd3 10.Bxh6 Nc5 {perfect coordination of black's minor pieces, e4 falling next} 11.Ng3 Bc6 12.Ke2 Bxe4 {taking with the bishop to avoid an opposite color situation} 13.Nxe4 Nxe4 14.g4 {no tempo to spare, have to start pushing our own passed pawns to restrict black's king to that side. This is still not a trivial endgame.} Nc3+ 15.Kd3 Kd5 16.g5 e4+ 17.Kc2 Ke6 18.g6 Kf6 19.g7 Kf7 20.Kb3 {key move to go after the vulnerable pawns now, d3 drops the knight and e3 met with Bxe3} Ne2 21.Kc4 d3 22.Kd5 Ng3 23.Ke5 Kg8 {no useful moves left} 24.Kd5 {Draw! anything other than repeating ends in an immediate simplification and trade of remaining pawns.}

```

Looking back at the position we started from, we've come a far way to be able to reassure ourselves that black's `Bc2-Nb2` variation is stoppable by `Ne2` and `f4,` and that was just one variation! You see, it looks drawish, it feels drawish, but to convince oneself that it is indeed a draw, it's far from trivial and only through concrete considerations of these variations one can really be sure, for instance no one *just knows* that our `g` pawn push would be fast enough at the end of that variation *without* having calculated. I hope this has been the sort of analysis of the endgame you were looking for. Very rarely in a middle-game one has to go through such long variations in order to make a decision, but in endgames often there's no other way.

## Recommendations

Some recommendations such that you can form a program for yourself (the list won't be exhaustive):

* As boring and repetitive as it sounds, read a basic book on endgames and you'll be subjected to all sorts of *common* situations, where you'll learn how to maneuver with rooks, bishops, knights and their combinations. You'll learn how and when to cut off the king, how to trap pieces, how to push passed pawns covered by knight, a bishop, a rook. How to force draws in endgames that are known to be trivially drawn etc. You won't have to memorise everything per se, but rather pick up the key ideas and ways of reasoning about these positions. For instance how to play the Philidor positions (where does your rook belong, when do you start giving checks and from which rank, then all of that from the side that has the pawn), similarly for the Lucena position and many others. These are sorts of endgames that if you simply don't sit down to study for yourself, you'll end up messing them up regularly. A very good book to get started is: "100 Endgames You Must Know: Vital Lessons for Every Chess Player" by Jesus de la Villa.
* Take the time to carefully study your own endgames after your games. First gather some ideas, then check the corresponding variations (mentally for as much of them that you can), and at the end go through your calculations with an engine. The routine is very similar to learning mathematics for example, nobody learns anything by immediately picking up the solution manual (here the engine). By the end of such study, you should have learned what kinds of questions you need to ask yourself in various endgames.
* Solve lots and lots of endgame tactics next to other tactics or puzzles that you do. This will sharpen your technique (and fill up your bag of ideas), both in saving hard positions and in conversions. Again, mental calculation to be prioritized. There are many sources for this, specially these days. A good start would be chesstempo or lichess.
* Study the games of strong players: follow their post-game analysis, go through their games and try to understand their decisions, watch the endless online content that is produced on a daily basis by strong players, as they play they will be explaining their reasoning, (couple of names: Yasser Seirawan, Peter Svidler, ChessExplained). This will add a new flux of digested knowledge in your way, and the goal will be to learn how they reason and asses positions under different circumstances (you will learn things that you may never necessarily find in books).
* Preferably play longer time control games in order to have chance to think during your endgames. Start getting into the mindset of anticipating the kinds of endgames your middle-game decisions will lead you to (only then can you come to the conclusion of what pieces or pawns will give you the best chances). Don't expect everything that you learn and study to influence your play immediately, chess is a very hard game, and these things always take time and dedication to residue naturally into your play. There are no easy ways.

With such a program and a consistent work routine, you will both improve your assessments of endgames, your calculations in them, and most importantly, become efficient in thinking about them. After some time, looking back at your example game here, you will very quickly convince yourself, with half the calculation we went through earlier, that such endgame ought to be drawn. Sure a lot of calculations will still be required, as is for everyone, but the difference will be that you'll have a better idea what aspects of the position you may need to pay a close attention to and what the key ideas are both for you and your opponent (for instance, you'll quickly know that if you're to stand any chance you need to start challenging black's pawn chain, and that you need some active plan to keep black's king out of play).
> 2 votes

# Answer
There are all kind of endgames, so it is a bit difficult to generalize, but still there are a few things that are relevant in many cases.

Just like in the middle game you can evaluate the position based on for instance:

* material (this is often the most important)
* piece activity
* weaknesses in pawn structure

Unlike in the middle game "king safety" is often irrelevant as with reduced material it is difficult to get mated and in fact the king often plays an active role in defending/attacking pieces.

If material is equal (as in this example), in many cases you can only win by promoting a pawn. The goal is then simply to create a *passed pawn* and push it to the other side of the board. To do this, you can either capture opposing pawns or make use of a pawn majority (basically, with the support of your own pawns to walk passed the opponent's pawns). So you should focus on how to create a passed pawn (and of course how to prevent your opponent from doing the same).

In order to improve your endgame technique you should also familiarize yourself with the most common endgames, such as:

* mating with K+Q vs K, K+R vs K, K+BB vs K
* winning or defending K+P vs K
* various endgames with pawns on both sides
* K+R and pawn(s) vs K+R (and pawn(s)). This is a very common endgame, but also very difficult to play properly. Perhaps too difficult at your current level.

Also you should know typical themes that appear in endgames like:

* zugzwang
* corresponding squares
* triangulation
* stalemate

---

With this in mind, regarding your example, you note that:

1. material is equal
2. opposite colored bishops (which tend to be more drawish)
3. symmetric pawn structure
4. blocked pawn chains
5. pawns on squares of the same color as the opponent's bishop (i.e. they can be attacked by either player. If the pawns were on the same color as the players' bishops, the position would be even more drawish as pawns would be even harder to attack and there would be an additional defender for the pawns (the respective bishop).
6. weak pawns on d3, g2 and g7

In order to win this position either side would need to create a passed pawn. Because of the symmetrical pawn structure it is difficult to achieve this by pawn breaks except for special situations like this. This leaves as the only option to somehow create a passed pawn by capturing enemy pawns.

How to do this? The most likely candidates for capture would be the weak pawns on d3, g2, g7, however these are easily defended by the king and if necessary the other pieces such as the knight on c1. Also note that it is not really possible to activate the kings (i.e. march the black king to somewhere around c3 or the white one to a more active square), because (i) white/black would have lots of time to attack and win the g7/g2 pawn and subsequently all the other pawns in the chain and (ii) the knight+bishop block the entrance on the a-b-c files (white covers the squares c4, b4, a3, b3 and black the squares c3, b3, b2, a2).

So it seems fairly impossible to just capture the weak pawns and also it seems impossible to create another weakness or passed pawn on the kingside through a pawn break. The last thing I'd check is if there is a possibility for a sacrifice (e.g. white could sacrifice a piece for two pawns on d4. However with the pawns being rather far from the promotion square it seems unlikely to succeed.

An agreed draw would be natural in this position, however at your level there is nothing wrong with playing on in order to practice and it is not impossible to make mistakes in this position. A plan for white could be to play g3 followed by f4 which could lead to another weak pawn on e5 (after capture fxe5 fxe5). Still with correct play it should be a draw.
> 4 votes

---
Tags: analysis, endgame, theory, beginner
---


title: 4 player chess tips

text:
# Question
Title: 4 player chess tips
I recently looked into chess.com's four player chess. Its fun but had little success until now. I usually try and play moves to open my diagonal pieces but centre queen rushes always bring trouble. I am trying to adapt to a new style now. Any idea what sort of opening/strategy I should go for? Also any tips involving captures or trading pieces would be helpful.

# Answer
> 2 votes
1700+ 4-player chess rating here (solid, but not amazing). A few tips:

1. A solid foundation and well-developed pieces quite often beat out a successful queen rush. At higher rated games you see rushes less and less, because even when successful you're sacrificing a lot of development. Just learn to live them.
2. Be extremely careful of checks from your left opponent. Since the other two players essentially get two free moves against you, a single check can decimate your position.
3. Play conservatively. Trading pieces is very seldomly the right choice (especially don't trade bishops for rooks, as they're worth the same amount of points and have fairly equal use with the diagonals being so much more important now). Be sure to leave as few weaknesses in your position as possible, as players tend to pounce on the weakest player.
4. Most games have elements of end-game pawn rush. It's good to be in the best position for this.
5. Practice spotting mates. There are some rather silly-looking ones, especially involving double-checks. As long as your position is reasonably solid, giving up your queen to get a checkmate on your left or right opponent is usually worth it. It's usually best if your opposite opponent survives, as end-game in the middle is difficult.
6. There's fairly wide range of viable opening moves and strategies. As long as your pawn-structure is sound, you have a lot more leeway to play around than in normal chess.
7. Knights are mostly defensive units used to hold your position together. As games are much more fluid and dynamic in 4p-chess attacking is mostly done using pieces that can get in and out fast. Knights should usually not be a priority in your openings.

# Answer
> 1 votes
One tip that I have learned is to establish your knights. Since these pieces can't have their checks blocked, you could use this to your advantage when trying to get an opponent's queen and other pieces. Knight forks are probably the best way to win the game.

# Answer
> 1 votes
I have never played 4 player chess but by analogy with other multiplayer games, I would try to avoid committing too early, and try to profit from opportunities that appear, above all avoiding being the “biggest threat” that all players will concentrqate on.

Line pieces are incredibly flexible and can attack out of nowhere. But knights and pawns take a long way to get anywhere and are not very frightening so early moves can be with these, although not enough pawn moves to weaken the structure.

A knight may then be able to mount some kind of a raid, and this is best when the opponent is already distracted.

# Answer
> 1 votes
A tip that I have is to build a great defensive in the beginning. When they start to fight each other, use line pieces to take out other opponents.

---
Tags: opening, strategy, tactics, chess-variants
---


# Question
Title: Rearrange chess diagrams (from an opening) in order. Useful as a puzzle?
Here is an example https://chess-tst.000webhostapp.com/chess.html

The task is to rearrange the diagrams in order (use drag&drop).

Do you think this activity could be useful for exploring and revision of chess tabias at the beginner\pre-intermediate level? As a part of opening preparation.

# Answer
> 2 votes
Nice fresh idea! I would not use it exclusively for opening training, but whatever works for your target group. Could be fun for younger players I guess. A few problems I see with this approach:

1. When doing the exercise I was basically only looking for small changes from the previous diagram. I mean, for me it did not matter at all that I was looking at a chess board. It could as well have been a series of paintings (with incremental changes) or anything else. If people solve it the same way as I did, I doubt that they get much out of the puzzle for chess.
2. I found looking through nine diagrams already quite time consuming, so I guess getting very deep (say 20 moves) is not very pracical.
3. Including side lines seems impossible unless you create a puzzle for each side line, however in that case you would lose the connection between them (i.e. that at move x you have options a, b and c...).
4. IMO, beginner players should focus on learning general opening principles, the reason behind making those moves and typical plans in certain pawn structures. Your approach seems to train learning lines by heart, which I don't find useful, because they'd be lost immediately once they are out of book.

Perhaps puzzles like these could be more useful for tactics or for basic endgames!?

Or perhaps, for slightly advanced players, it could be useful to have something like this, not move-by-move, but only showing relevant positions (tabiyas) skipping over intermediate moves.

# Answer
> 1 votes
I like it! I think this is a good way to study an opening line through active learning. It's too easy for me sometimes to just skim through a line in a book and then forget it when I can use it in an actual game.

---
Tags: opening, puzzles, training
---