# Question
Title: Are certain tactics always good or does it really depend on the game?
I've recently joined chess.com at the suggestion from chess club.

Something I've always struggled to understand with chess is why certain moves are "good" and why others are "bad"

I got thinking about this especially recently as I played around with the tactics on chess.com. Some of the "answers" were obvious- of course you'd take the bishop with your king if it meant getting you out of check and there was no consequence for moving the king to that spot.

But there were other times where it seemed a bit murkier. It had you mess around with the king until you could take the rook. What if you don't want to take the rook? And would that move only be good for that particular setup? You're never going to be in the exact same setup they give you in tactics. There's way too many combinations.

Is a good move = something that will get you closer to checkmate? Or is it more subjective, and good = ridding of a piece.

Some excellent chess games have been played without removing a single piece from the board. What makes that good and others not good? How do you realize what a good move is?

# Answer
> 8 votes
TL;DR - Winning material is usually good but it's checkmate that wins a game of chess.

In chess there is only 1 primary aim, to checkmate your opponent before she checkmates you. ALL other aims are secondary. Thus a good move is one that makes you more likely to checkmate your opponent before she can checkmate you. End of story.

However great though that be it doesn't always provide a whole load of practical guidance when sat at the board with the clock ticking louder and louder. Thus as players of the game we employ a number of secondary objectives that experience has taught us will, with a good degree of probability, lead to the primary objective above, e.g. control the centre, develop your pieces, force your opponent to make weaknesses, win material, with your extra forces checkmate your opponent - it's only the last that counts, the others are just useful, but often very useful, stepping stones to that end.

To get to some of the more specific parts of your post, yes, the vast majority of times winning material is a good thing. To use the military analogy you now have more soldiers than your opponent, and more soldiers in a war is generally a good thing. Here's an example from a game I played at the club earlier this week:

```
[White "Me"]
[Black "My Victim"]
[Result "1-0"]
[FEN "r3q1rk/pp2p1bp/3p1p2/3P1PnQ/2P1B2R/1P2B3/P6P/2R4K w - - 0 1"]

1.Bxg5 Qxh5 2.Rxh5 fxg5 3.f6 h6
    ( 3...Bxf6 4.Rxh7# )
4.fxg7+ Kxg7 5.h4 1-0

```

Why has my opponent resigned? Well ultimately it is because he believes I am a good enough player that one extra piece is enough for me, in the long run, to force checkmate against him. At the board he'll say "Oh, I dropped a piece to Ian so resigned", but this is really a short hand for the above - Checkmate is the ultimate aim in chess, all others are secondary.

However you are also right in saying that it does depend on the particular situation, and this is because while a great aim winning material doesn't win the game of chess, checkmate does. And thus occasionally a player will give up material because he or she thinks or has calculated that doing so will make it more likely that they will checkmate their opponent before their opponent checkmates them. Be very clear that this is the exception rather than the norm, but it's having to evaluate such possibilities that makes chess such a great game! As an example here's one of my favourite games of all time. Black gives up loads of material but it's all toward the end of queening one of his pawns, and with his new queen he will checkmate his opponent - and checkmate is how you win a game of chess!

```
[Event "Student Olympiad, Marianske Lazne"]
[Site "Marianske Lazne CSR"]
[Date "1962.07.??"]
[Result "0-1"]
[White "Eduard Gufeld"]
[Black "Lubomir Kavalek"]
[ECO "C64"]
[PlyCount "64"]
[FEN ""]

1. e4 e5 2. Nf3 Nc6 3. Bb5 Bc5 4. c3 f5 5. d4 fxe4 6. Ng5 Bb6
7. d5 e3 8. Ne4 Qh4 9. Qf3 Nf6 10. Nxf6+ gxf6 11. dxc6 exf2+
12. Kd1 dxc6 13. Be2 Be6 14. Qh5+ Qxh5 15. Bxh5+ Ke7 16. b3
Bd5 17. Ba3+ Ke6 18. Bg4+ f5 19. Bh3 Rhg8 20. Nd2 Bxg2
21. Bxg2 Rxg2 22. Rf1 Rd8 23. Ke2 Rxd2+ 24. Kxd2 e4 25. Bf8 f4
26. b4 Rg5 27. Bc5 Rxc5 28. bxc5 Bxc5 29. Rab1 f3 30. Rb4 Kf5
31. Rd4 Bxd4 32. cxd4 Kf4 0-1

```

# Answer
> 1 votes
Recently I had a memorable position where Black could win White's bishop with a fork:

```
[White "Ben Cassidy"]
[Black "furrykef"]
[FEN "8/p1p1k3/1p3pK1/1P1nP3/7P/3B4/8/8 b - - 1 46"]

1...Nf4+ 2.Kg7 Nxd3?? 3.exf6+

```

...and suddenly Black is in deep trouble, because White's pawn on f6 is unstoppable and it will become a queen. It's almost always correct to win a piece when possible, but "almost always" is not "always"!

The key is to look at what your opponent can do to you after you make your move or sequence of moves. Otherwise, you might be walking into a trap!

---
Tags: learning, theory
---


title: Pawns pushes in the center

text:
# Question
Title: Pawns pushes in the center
There are some situations in chess where a pawn push in the center is the most played move, and also the one suggested by engines. However this is not done for winning material, but just for trading pawns. One such example arises from the Philidor Defense:

```
rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1
1. e4 e5 2. Nf3 d6 3. d4 exd4 4. Nxd4 Nf6 5. Nc3

```

`3. d4` is the move I'm talking about, and the game after that move usually continues like in the PGN above.
I don't fully understand the advantages that White gains by exchanging its *d*-pawn for Black's *e*-pawn, ending in the position shown above. They are both central pawns controlling central squares. Can someone tell me some insight or considerations I'm probably missing?

# Answer
> 9 votes
The main ideas behind d4 serve several purposes.

1. It threatens dxe5 winning material.
2. It opens up your pieces, like the Bc1, in particular.
3. It gains space since the trade on d4 leaves white with a pawn that is more central than black's d6 pawn.
4. And probably most important, and this is typical of many double-king-pawn openings, and that is that it is easier to inhibit black from playing the freeing d5 move. If he manages that move soon, he has generally solved all his opening problems, and the two center files will open up, and the major (heavy) pieces will be traded.

# Answer
> 6 votes
Warning: I am only 1800 rated in lichess.

I believe one reason for playing 3.d4 is that after the exchange on d4. White has a majority of pawns in the kingside which is one of the reasons to later mount an attack on the kingside.

If Black tries to hold on to the square d5 with Nc6(Nd7), White can then play Bb5 putting under attack once again the d5 pawn. Then, Black is probably more or less forced to exchange on d4 as defending the d5 pawn with Qe7 looks bad for Black. The black-coloured bishop has bad prospects and even after fianchettoing, White could probably close the center with d5 and then it is claear it will be hard for Black to activate its bishop.

# Answer
> 4 votes
White has for sure achieved various advantages:

1. The white knight at d4 is well centred
2. Black's pawn at d6 blocks the bishop on f8 from developing
3. Black will probably complete development by putting bishop on e7, knight from b8 to d7 and castling, which is a solid but cramped position for a long time
4. From a practical standpoint white's position is easier to play. Plans are easier to find. White could castle either king or queenside, or could eventually look at playing f4 with an e5 central crush through. In a tournament game with a clock running white would have a nice practical position and black has to find a plan somewhere

For all the above white playing d4 and letting the pawns exchange \[d pawn for e pawn\] is all worth it for white. It was the cramped, unambitious move 2...d6 that made it worth it for white.

---
Tags: opening, strategy, pawns
---


title: How could one cheat on Lichess?

text:
# Question
Title: How could one cheat on Lichess?
I was playing a game on Lichess the other day and all of a sudden the system ended the game, awarded me the victory, and said "Cheating by White detected".

How in the world could you cheat on Lichess? Does anyone know what this means? My rating is 1250 – who would bother to cheat against me?

# Answer
> 31 votes
How could you cheat? This is what the Lichess terms of service say about it:

> **Cheating**. We define this as using any external assistance to strengthen your knowledge and, or, calculation ability to gain an unfair advantage over your opponent. Some examples would include computer engine assistance, opening books (except for correspondence games), endgame tablebases, and asking another player for help, although these aren’t the only things we would consider cheating.

The most common form of cheating is using an engine. I don't know the details of what Lichess does, but cheating detection can consist of comparing a player's moves to those proposed by various engines, and based on statistical analysis one can come up with criteria for when the player's moves were "suspiciously similar" to an engine's.

Lichess also allows people to register bot accounts, but those must be clearly labelled as bots. So I suppose that another form of cheating could be to create a bot account and pretend that it is a human.

I also found this old FAQ:

> 4. How are cheaters identified?
>
> A:
>
> * Using the suspicious games themselves. The degree to which computer players differ in playing style and strength, to most human opponents that rely on them, is in most cases enough to reverse-engineer information from the game beyond what moves were made.
> * Using the player's other games. A player's profile shows all their games, including games where it is apparent that there was no cheating. Games where a player cheated and games where a player did not cheat have very different results when reviewing them using a chess engine (or Lichess' computer analysis feature).
> * Using the player's history. On every player's profile are public graphs of rating and average history, game database exports upon request, and win to loss ratio.
> * Time statistics. Anyone can see the public time consummation information for games, i.e., the time-per-moves.
> * A statistical analysis of the suspected user's playing behaviour. This statistical analysis is only visible to the lichess team.
> * Copying and pasting the suspicious game(s) into an engine and seeing how similar the moves are.

# Answer
> 2 votes
If you go on chess.com you will see that you can analyze games in a lot of detail. This analysis can compare to state of the art chess engines and determine whether your moves were "human-like" in their accuracy (for each piece) or if you simply made "engine-like" moves. For example, if each one of your moves was classified as the best possible move in that position - that would raise a flag especially if your rating is nowhere near the engine that would struggle to make those moves.

On that note, if you play on lichess (slow games), your opponent could theoretically use the board editor and analysis tools to make your moves and see what the computer would do in response. Then they would simply play those moves against you.

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


title: Advance of d4 in the Ruy Lopez

text:
# Question
Title: Advance of d4 in the Ruy Lopez
I was White in this position, and Black had just played f6.

```
[FEN "r1bqkb1r/ppppn1pp/2n2p2/1B2p3/4P3/5N2/PPPP1PPP/RNBQ1RK1 w kq - 0 1"]

```

I played c3 to prepare a push of d4 and strike the center.

When analyzing this position later, the engine suggested that 5. d4 Nxd4 6. Nxd4 exd4 7. Qxd4 was superior (+1.7) than my 5. c3 (+0).

I don't really understand what White advantage has in this line. In general, I don't really know when I should exchange the d4 pawn in the Ruy Lopez and what benefit I get from such exchanges of central pawns. Can anyone help me understand?

# Answer
First, I agree that f6 is both weakening and a waste of time.

The real crux of the matter is that in most double-king pawn openings, white tries to play d4 and after the trade e5xd4, he tries to outpost a N on d5, which exerts great pressure on black. If black can play d5, and I do not agree that he has the initiative there after the better d3, he does get easy equality with plenty of space.

In both this opening, and in most Sicilians, you should be on the lookout for when black can play d5. If he gets it in, then he usually has gained equality, so you want to think prophylactically, and play moves that inhibit d5.

Your plan of trying to put two pawns in the center is admirable, but if it were possible, it would be excellent, however, it is just not possible there.
> 5 votes

# Answer
f6 is a shockingly bad move which badly weakens black's kingside and does nothing for his development.

d4 would take advantage of this and keep the initiative. c3 is a weak move which gives black the time he needs to strike in the now reinforced center and justify his previous bad play. Black can play d5 and suddenly it is black who has the initiative. For example:

```
[FEN "r1bqkb1r/ppppn1pp/2n2p2/1B2p3/4P3/5N2/PPPP1PPP/RNBQ1RK1 w kq - 0 1"]

1. c3 (1. d4 exd4 2. Nxd4 Nxd4 3. Qxd4 Nc6 4. Qd1) d5! 2. exd5 Qxd5

```

Now black is threatening Bg4 and O-O-O and he will have a fine game.

> In general, I don't really know when I should exchange the d4 pawn in the Ruy Lopez and what benefit I get from such exchanges of central pawns.

Apart from just knowing the opening moves it is also important to understand two other things:

* Your plans
* Your opponent's plans

In general in king's pawn openings any time black can play d5 successfully he has equalised and the opening has been a success. You need to understand this and make sure you don't allow this without extracting some other concession from black.
> 4 votes

# Answer
The moves ...Nge7 and ...f6 slow down Black's development and he will need a few tempi to castle. Meanwhile, White is already castled and is sufficiently developed. This gives you enough incentive to blast open the centre with d4, since Black is ill-equipped to respond effectively.

Normally pushing d4 like this without c3 in the Ruy Lopez isn't a good idea. However, this is an exception because of how inefficiently Black is developing.
> 4 votes

# Answer
The Ruy Lopez is a very flexible and therefore subtle opening. Black has a wide choice of replies and really has a kind of initiative in that the onus is on White to find a good response to whatever Black does. I take it that this game began with 1.e4 e5 2.Nf3 Nc6 3.Bb5 Ne7. This is the Cozio Defence. This has never been all that popular, but it has at least one Grandmaster proponent. This is Alexey Dreev, and you might like to look at his online e-book. It has also been played by Levon Aronian ans Sergey Karjarkin

A critical line is 4.Nc3 g6 5.d4 exd4 6.Nd5 and there is a lot going on that is quite different from the lines that been discussed. In your game you played 4.0-0 which cannot be a bad move but is not quite as ambitious as the line above. The timing of Whites push to d4 is very critical in this line. Your opponents move of 4..f6 is well-motivated to hold the center, but badly timed. There is a line in the Steinitz Defence Deferred (3..a6 4.Ba4 d6 5.Bxc6+ bxd6 6.d4 and now ..f6 is the book move. It is safer after the exchange on c6 because White has given up his light squared bishop. But in your game, ..f6 was badly timed because you still have that nice Bishop and the immediate d4 forces Black to give up the center. This is not so much a matter of tempi, but Blacks pawn structure does not then fit with any nice pattern of development.

A great deal could be said about the niceties of d4 in the Lopez. You might try playing the Cozio yourself. You will puzzle almost every opponent below master strength.
> 1 votes

---
Tags: opening, strategy, ruy-lopez, center
---


# Question
Title: Can a player move before his opponent hits the clock?
In a reply to another question, I made an explicit presumption that under FIDE Laws, a player can move as soon as the opponent’s move has been made. But someone wondered if this was this really correct.

The Laws make a distinction between a move being ‘made’ and a move being ‘completed’ (when the clock has been hit). As far as I can tell, the former (under which the waiting player is said to ‘have the move’) is sufficient for allowing the next player to move. But there is no rule which says you can move when you have the move, maybe because it’s deemed too obvious.

As far as I can see the following scenarios are legitimate:

```
A: move
B: move
B: hit clock but nothing happens
A: hit clock
B: hit clock

A: move
B: move
A: move
A: hit clock
B: move
B: hit clock

```

And might as well list a related scenario:

```
A: move
B: wait for A to realise
A: hit clock

```

But I am not an arbiter. Can a player move before their opponent hits the clock?

# Answer
There is no requirement to wait until the opponent has pressed the clock before making your move. However issues can arise with getting the increment to which the player is entitled for every move made if the clock is not pressed and this is spelled out in the FIDE Laws of Chess:

> 6.2.1 During the game each player, having made his move on the chessboard, shall stop his own clock and start his opponent’s clock (that is to say, he shall press his clock). This “completes” the move. A move is also completed if:
>
> 6.2.1.1 the move ends the game (see Articles 5.1.1, 5.2.1, 5.2.2, 9.6.1 and 9.6.2), or
>
> 6.2.1.2 the player has made his next move, when his previous move was not completed.
>
> 6.2.2 A player must be allowed to stop his clock after making his move, even after the opponent has made his next move. The time between making the move on the chessboard and pressing the clock is regarded as part of the time allotted to the player.

From 6.2.1.2 it is clear that is fine for player B to make his move before player A has pressed the clock to complete his previous move.

From 6.2.2 it is clear that in that case player A is entitled to press the clock for that move even after player B has made a quick move.

The act of pressing the clock fulfils two functions:

* It "completes" the move. This is important because an illegal move is not punishable and can be retracted without penalty if the move hasn't been completed.
* It is the action which gives the player the increment to which he is entitled.
> 12 votes

# Answer
According to rule 1.2:

> The player with the light-coloured pieces (White) **makes** the first move, then the players move alternately, with the player with the dark-coloured pieces (Black) **making** the next move.

Note the word "makes"/"making". The past tense of this word is "made".

Then if we skip ahead a little:

> 4.7 The move is considered to have been **made** in the case of:
>
> 4.7.1 a capture, when the captured piece has been removed from the chessboard and the player, having placed his own piece on its new square, has released this capturing piece from his hand,

There is no requirement that the clock be hit for a move to have been made. And once the move has been made, "the players move alternately." Nothing in the rules prohibits the next player from moving at that point.
> 5 votes

---
Tags: rules, fide
---


# Question
Title: Which FIDE rule forbids pressing the clock before taking captured pieces off the board?
A long time ago I used to play OTB blitz chess at a chess club. We had club blitz tournaments \[5 mins each with no increment because the clocks were old-school chess clocks\]. I was new to blitz. I had a habit when taking off material, such as an exchange, of pressing my clock with my hands still on the board and being yet to take off the material. This ate into my opponent's time. One strong opponent who was an official chess arbiter once responded by pressing my own clock and saying "move on your own time".

I agree that my habit was wrong. I tried to stop doing it. Where in the FIDE laws of chess would it cover this habit?

# Answer
> 9 votes
It sounds like you were breaking the rules on several fronts.

According to the FIDE Laws of Chess:

> 6.2.3 A player must press his clock with the same hand with which he made his move. It is forbidden for a player to keep his finger on the clock or to ‘hover’ over it.

You would probably be punished under the illegal move rules:

> 7.5.2 If the player has moved a pawn to the furthest distant rank, pressed the clock, but not replaced the pawn with a new piece, the move is illegal. The pawn shall be replaced by a queen of the same colour as the pawn.
>
> 7.5.3 If the player presses the clock without making a move, it shall be considered and penalized as if an illegal move.
>
> 7.5.4 If a player uses two hands to make a single move (for example in case of castling, capturing or promotion) and pressed the clock, it shall be considered and penalized as if an illegal move.
>
> 7.5.5 After the action taken under Article 7.5.1, 7.5.2, 7.5.3 or 7.5.4 for the first completed illegal move by a player, the arbiter shall give two minutes extra time to his opponent; for the second completed illegal move by the same player the arbiter shall declare the game lost by this player. However, the game is drawn if the position is such that the opponent cannot checkmate the player’s king by any possible series of legal moves.

It sounds like you were either moving with one hand and pressing the clock - 6.2.3 or using two hands to make the move - 7.5.4

# Answer
> 8 votes
Brian's fine answer already established you were breaching some rules, but here are some more basic FIDE rules:

> **4.6** \[...\] The move is then considered to have been made: a. in the case of a capture, when the captured piece has been removed from the chessboard and the player, having placed his own piece on its new square, has released this capturing piece from his hand

So you haven't finished making your move yet if you haven't removed the piece. And there is

> **6.7a.** During the game each player, **having made his move on the chessboard**, shall stop his own clock and start his opponent’s clock.

(Emphasis mine) You can't stop your clock when your move isn't even made yet, of course.

---
Tags: rules, fide, time-management
---


# Question
Title: Minimax algorithm - Play with Black pieces?
**Motivation:**

I am trying to make a basic AI agent that can play chess against an opponent. The goal is to see how good it can become through the use of machine learning later on and also learn the fine details in chess that are hidden from us when we just play it, such as evaluation parameters.

---

**Code:**

Here is what I have so far:

```
import chess, chess.pgn, time, math, io
import numpy as np

from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.action_chains import ActionChains
from selenium.webdriver.support.ui import Select

piece_values = {'P': 10, 'N': 30, 'B': 30, 'R': 50, 'Q': 90, 'K': 100, 'p': -10, 'n': -30, 'b': -30, 'r': -50, 'q': -90, 'k': -100}

# These are all flipped
position_values = {
        'P' : np.array([ [0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0],
                        [5.0,  5.0,  5.0,  5.0,  5.0,  5.0,  5.0,  5.0],
                        [1.0,  1.0,  2.0,  3.0,  3.0,  2.0,  1.0,  1.0],
                        [0.5,  0.5,  1.0,  2.5,  2.5,  1.0,  0.5,  0.5],
                        [0.0,  0.0,  0.0,  2.0,  2.0,  0.0,  0.0,  0.0],
                        [0.5, -0.5, -1.0,  0.0,  0.0, -1.0, -0.5,  0.5],
                        [0.5,  1.0, 1.0,  -2.0, -2.0,  1.0,  1.0,  0.5],
                        [0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0] ]),

        'N' : np.array([[-5.0, -4.0, -3.0, -3.0, -3.0, -3.0, -4.0, -5.0],
                       [-4.0, -2.0,  0.0,  0.0,  0.0,  0.0, -2.0, -4.0],
                       [-3.0,  0.0,  1.0,  1.5,  1.5,  1.0,  0.0, -3.0],
                       [-3.0,  0.5,  1.5,  2.0,  2.0,  1.5,  0.5, -3.0],
                       [-3.0,  0.0,  1.5,  2.0,  2.0,  1.5,  0.0, -3.0],
                       [-3.0,  0.5,  1.0,  1.5,  1.5,  1.0,  0.5, -3.0],
                       [-4.0, -2.0,  0.0,  0.5,  0.5,  0.0, -2.0, -4.0],
                       [-5.0, -4.0, -3.0, -3.0, -3.0, -3.0, -4.0, -5.0] ]),

        'B' : np.array([[-2.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -2.0],
                       [-1.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0, -1.0],
                       [-1.0,  0.0,  0.5,  1.0,  1.0,  0.5,  0.0, -1.0],
                       [-1.0,  0.5,  0.5,  1.0,  1.0,  0.5,  0.5, -1.0],
                       [-1.0,  0.0,  1.0,  1.0,  1.0,  1.0,  0.0, -1.0],
                       [-1.0,  1.0,  1.0,  1.0,  1.0,  1.0,  1.0, -1.0],
                       [-1.0,  0.5,  0.0,  0.0,  0.0,  0.0,  0.5, -1.0],
                       [-2.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -2.0] ]),

        'R' : np.array([[ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,  0.0],
                       [ 0.5, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0,  0.5],
                       [-0.5, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -0.5],
                       [-0.5, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -0.5],
                       [-0.5, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -0.5],
                       [-0.5, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -0.5],
                       [-0.5, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -0.5],
                       [ 0.0, 0.0, 0.0, 0.5, 0.5, 0.0, 0.0,  0.0]]),

        'Q' : np.array([[-2.0, -1.0, -1.0, -0.5, -0.5, -1.0, -1.0, -2.0],
                       [-1.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0, -1.0],
                       [-1.0,  0.0,  0.5,  0.5,  0.5,  0.5,  0.0, -1.0],
                       [-0.5,  0.0,  0.5,  0.5,  0.5,  0.5,  0.0, -0.5],
                       [-0.5,  0.0,  0.5,  0.5,  0.5,  0.5,  0.0, -0.5],
                       [-1.0,  0.5,  0.5,  0.5,  0.5,  0.5,  0.0, -1.0],
                       [-1.0,  0.0,  0.5,  0.0,  0.0,  0.0,  0.0, -1.0],
                       [-2.0, -1.0, -1.0, -0.5, -0.5, -1.0, -1.0, -2.0]]),

        'K' : np.array([[ -3.0, -4.0, -4.0, -5.0, -5.0, -4.0, -4.0, -3.0],
                       [ -3.0, -4.0, -4.0, -5.0, -5.0, -4.0, -4.0, -3.0],
                       [ -3.0, -4.0, -4.0, -5.0, -5.0, -4.0, -4.0, -3.0],
                       [ -3.0, -4.0, -4.0, -5.0, -5.0, -4.0, -4.0, -3.0],
                       [ -2.0, -3.0, -3.0, -4.0, -4.0, -3.0, -3.0, -2.0],
                       [ -1.0, -2.0, -2.0, -2.0, -2.0, -2.0, -2.0, -1.0],
                       [  2.0,  2.0,  0.0,  0.0,  0.0,  0.0,  2.0,  2.0 ],
                       [  2.0,  3.0,  1.0,  0.0,  0.0,  1.0,  3.0,  2.0 ]])}

class LichessBot:
    def __init__(self, fen):
        self.fen = fen
        self.bot = webdriver.Firefox(executable_path=r'geckodriver.exe')

    def initialize(self):
        bot = self.bot
        bot.get('https://lichess.org/editor/rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR_w_KQkq_-')
        time.sleep(3)
        analysis = bot.find_element_by_css_selector(".actions > a:nth-child(2)").click()
        time.sleep(1)

    def gameSelect(self, fen):
        bot = self.bot

        fen_area = bot.find_element_by_class_name("analyse__underboard__fen")
        bot.execute_script('arguments[0].setAttribute("value", arguments[1]);', fen_area, fen)

        # Refresh the page to enter new fen number properly every time
        fen_new = bot.find_element_by_class_name("analyse__underboard__fen").get_attribute('value').replace(' ', '_')
        bot.get('https://lichess.org/analysis/standard/{}'.format(fen_new))

    def gameReturn(self):
        bot = self.bot

        fen_return = bot.find_element_by_class_name("analyse__underboard__fen").get_attribute('value')
        time.sleep(1)
        return fen_return

def positionEvaluation(position, piece_values=piece_values, position_values=position_values):
    # Position of pieces is not taken into account for their strength
    if position_values == 'None':
        total_eval = 0
        pieces = list(position.piece_map().values())

        for piece in pieces:
            total_eval += piece_values[str(piece)]

        return total_eval

    else:
        positionTotalEval = 0
        pieces = position.piece_map()

        for j in pieces:
            file = chess.square_file(j)
            rank = chess.square_rank(j)

            piece_type = str(pieces[j])
            positionArray = position_values[piece_type.upper()]

            if piece_type.isupper():
                flippedPositionArray = np.flip(positionArray, axis=0)
                positionTotalEval += piece_values[piece_type] + flippedPositionArray[rank, file]

            else:
                positionTotalEval += piece_values[piece_type] - positionArray[rank, file]

        return positionTotalEval

def minimax(position, depth, alpha, beta, maximizingPlayer, bestMove = 'h1h3'):
    if depth == 0 or position.is_game_over():
        return positionEvaluation(position, piece_values, position_values), bestMove

    if maximizingPlayer:
        maxEval = -np.inf
        for child in [str(i).replace("Move.from_uci(\'", '').replace('\')', '') for i in list(position.legal_moves)]:
            position.push(chess.Move.from_uci(child))
            eval_position = minimax(position, depth-1, alpha, beta, False)[0]
            position.pop()
            maxEval = np.maximum(maxEval, eval_position)
            alpha = np.maximum(alpha, eval_position)
            if beta <= alpha:
                break
        return maxEval

    else:
        minEval = np.inf
        minMove = np.inf
        for child in [str(i).replace("Move.from_uci(\'", '').replace('\')', '') for i in list(position.legal_moves)]:
            position.push(chess.Move.from_uci(child))
            eval_position = minimax(position, depth-1, alpha, beta, True)
            position.pop()
            minEval = np.minimum(minEval, eval_position)
            if minEval < minMove:
                minMove = minEval
                bestMin = child

            beta = np.minimum(beta, eval_position)
            if beta <= alpha:
                break

        return minEval, bestMin

# # To check evaluation
# board = chess.Board()
# print(positionEvaluation(board))
# quit()

# Initialize and set up position
lichess = LichessBot('rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq -')
lichess.initialize()

board = chess.Board()
fen = board.fen()
lichess.gameSelect(fen)

while not board.is_game_over():
    if board.turn == True:
        print('\n[INFO] Your Turn\n=========================')
        fen_new = fen
        while fen_new == fen:
            fen_new = lichess.gameReturn()
        board = chess.Board(fen_new)

    else:
        print('[INFO] AI\'s Turn\n')
        minimaxEval, bestMove = minimax(board, 4, -np.inf, np.inf, False)
        print("AI Evaluation: {}\nAI Best Move: {}".format(minimaxEval, bestMove))
        board.push(chess.Move.from_uci(bestMove))
        print("{}\n=========================".format(board))
        fen = board.fen()
        lichess.gameSelect(fen)

```

This is what the code does:

* Open firefox terminal and go to lichess.org
* Enter the analysis mode for a starting chess position
* Wait for human player to make a move
* Send the FEN to the python program to make that move
* Apply minimax algorithm with corresponding depth and position values to evaluate the position and decide the best move
* Make this move in the python program
* Get the FEN of the current position
* Play the best move on the board by pasting FEN into the analysis on lichess

---

**Question:**

Right now this only lets me play as the white pieces (computer algorithm works on the black pieces). My question, although it seems basic, is how to make it so that at the start I have the choice of which side to choose? It seems like the minimax algorithm is baised towards computer playing with the black pieces and any attempt I make to adjust this failed to work.

---

**Output:**

Here is what a typical output on the console would look like while the game is going on. Nothing special happens when the game ends, I plan to include a summary of the game and outcome later on.

As can be seen, I make sure to double check that the moves are correctly registered by printing the board setup position in the console output after every move.

---

**Final Note:**

I am aware the evaluation metric and maybe even the efficiency of the algorithm might not be the best but these will be adjusted once all the fine details, such as the one posted in the question, are answered.

# Answer
> 3 votes
There are two simple adjustments that need to be made for this to work properly with the computer playing the white pieces. I'm not totally familiar with the interfaces you're using so bear with me.

```
while not board.is_game_over():
    if board.turn == True:

```

This if statement is used to determine at which point the computer starts evaluating moves and at which point it waits for user input. By changing this to

```
while not board.is_game_over():
    if board.turn == False:

```

We can make the computer evaluate moves on white's turn instead of black's. Obviously it would be best to handle this with a value that wasn't hardcoded so that based on some user input we could determine which side the user wanted to play. I'll leave that as an exercise for the reader (since you're using selenium perhaps it's possible to detect when the player flips the board around).

Now onto the minimax algorithm. The minimax function itself is doing what it is meant to do, however your evaluation function is locked into evaluating *black's* position on the board. This means that even though the computer is controlling white's pieces, it is still trying to make black have the best position. This is due to the piece values and the position tables that you are using.

The simple fix for this is something like the following:

```
def minimax(position, depth, alpha, beta, maximizingPlayer, bestMove = 'h1h3'):
    if depth == 0 or position.is_game_over():
        if (computer == "BLACK"):
            return positionEvaluation(position, piece_values, position_values), bestMove
        else:
            return -1*positionEvaluation(position, piece_values, position_values), bestMove

```

Where "computer" is some variable you've defined that stores the current player that the computer is evaluating.

We simply invert the evaluation when white is being controlled and the minimax algorithm gives the expected results.

---
Tags: engines, online-chess, chess-ai, minimax
---


# Question
Title: Possible game result combinations in a FIDE tournament report file
I am currently working on a small side project and want to write a chess tournament manager in Haskell. To properly set up the data structures I am wondering what the possible results of a chess game are.

The TRF (tournament report file) specification by FIDE describes the following eight (single player) results:

*Regular Game*

1. Win
2. Draw
3. Loss

*Unrated Results (game lasted more than one move)*

4. Win (unrated)
5. Draw (unrated)
6. Loss (unrated)

*Forfeit Results*

7. Forfeit Win
8. Forfeit Loss

Not considering (pairing allocated) Byes, this would amount to 8x8 = 64 theoretically possible combinations, most of which are probably nonsensical or extremely rare.

However, I think the combination `(Draw, Loss)` exists for example when one player doesn't have sufficient material to end the game and the other one gets disqualified by the arbiter. Maybe even `(Forfeit Loss, Loss)` exists, when player A does not arrive to the game and player B offends the arbiter and thus gets his game counted as a loss.

So which combinations exist additionally to the following obvious ones?

```
{(1, 3), (2, 2), (3, 1), (4, 6), (5, 5), (6, 4), (7, 8), (8, 7)}

```

# Answer
One additional set of result combinations arises if you are unrated but about to get a rating and you play a rated player. Then, because you are unrated, the game will not be rated for your opponent but, because it forms part of your results which give you a rating, it will be rated for you.

Hence, you can add (1,6), (2,5) and (3,4)

PS I've edited the title of your question because the original was almost identical to this already answered question - What are the possible results of a game?. However you are asking something different.
> 2 votes

---
Tags: rules, software, fide
---


# Question
Title: Is the FIDE International Organizer title required to organize high level FIDE tournaments?
The FIDE Handbook has a section called Regulations on Seminars & Title Award for Organizers where it describes what you need to do to get the FIDE International Organizer title. It says:

> Scope / Mission: To get the FIDE licence for the organisation of FIDE, Continental and International tournaments.

Now, I know that the title is not a requirement to organize a low level FIDE rated tournament because I have done so in my club along with another player who also has no organizer title.

My question is: is it a requirement for high level tournaments and if so, where is the border between requiring the title and not needing it?

# Answer
It looks like the answer is "No" because Arkady Dvorkovich, who has no organizer title, was the chief organizer for the FIDE Grand Prix Series Riga- 2019, FIDE Grand Prix Series Riga- 2019 Blitz Tie-breaks and FIDE Grand Prix Series 2019 Rapid Tie-breaks tournaments.

However there is an additional *paid* position for "FIDE World Events" called a "FIDE Technical Director". The role is described here.

> 1. FIDE Technical Director (FTD) is the overall observer of a FIDE World Event
> 2. The FIDE Technical Director FTD is appointed by FIDE and must be a licensed International Organizer
> 3. Main duties of the FIDE Technical Director"
>     * To be responsible for the communication with the Organizer after the approval and circulation of the tournament regulations.
>     * To check before the start of the competition if the organization adheres to FIDE standards.
>     * To check if the Organizer provides to the participants the conditions offered in the bid and described in the event invitation.
>     * To be contacted by the National Federations as the FIDE Representative.
>     * To ensure the contact of the competitions according to FIDE rules and regulations
>     * By the end of the competition to send his report to FIDE including and comparing the final evaluation with the bid-evaluation.
> 4. Organizer provides the following conditions to the FIDE Technical Director:
>     * Single room (FB- 3 meals) 2 days before the start of the competition till departure
>     * Air-travel expenses & transportation to the venue
> 5. FIDE pays to the FIDE Technical Director the stipend in accordance with the Financial Guidelines for the Technical Officials.
> 1 votes

---
Tags: rules, fide
---


title: Chess PhD topic in machine learning?

text:
# Question
Title: Chess PhD topic in machine learning?
I searched this online and couldn't find sufficient answers. Is there a topic in chess that includes machine learning and would be sufficient for a PhD thesis? I was thinking of utilizing a CNN that tells you the correct move based on the current position (and previous couple of moves) without calculating all the tree branch moves ahead. Would this be feasible?

# Answer
You have little chance in your dissertation of surpassing state of the art chess engines. Perhaps you could find a hook which hasn't been explored so much. One idea is to train your program to play *amateur chess* in a convincing way. Can a program pass a sort of chess Turing Test where a human-player couldn't tell if they were playing an AI or playing a player rated e.g. 1600? When I play computer chess programs with a level setting at a level that I can actually beat, there is something not quite right about it. The program is deliberately hobbled (so I can beat it) in such a way that it sometimes makes blunders that a human player of the target level is unlikely to do, but at other times it still makes moves which seem just too good for that level. Trying to imitate *human* chess-playing rather than targeting optimal chess-playing seems like an interesting AI problem.
> 51 votes

# Answer
You might be interested in AlphaZero and its derivatives. AlphaZero is the original neural-network based chess engine; since then there have been various other attempts (Leela Chess Zero, AllieStein, the recent Fat Fritz ...) to replicate AlphaZero's ideas. The key paper to read is this one.

The data right now seems to indicate that although these neural network engines are very strong, the conventional chess engine Stockfish is still the strongest engine on the planet on consensus equal hardware. That said, the situation is fluid; a few months ago Leela was probably the strongest.

I do not know if there's enough material here for a PhD project, but there's a great deal of territory to cover.
> 17 votes

# Answer
There are plenty of possible Phd-topics that connect chess and machine learning. The more interesing and feasible ones have nothing to do with building better engines. Here are some ideas:

* Human players have a particular playing style. Is it possible to learn to extract some metric of style from games that allows to assign games to players with a certain probability?
* Can you use this model to simulate games by any particular player?
* Humans play chess via an intuitive feel for the position. Engines used to just calculate on top of a simple evaluation function. Is it possible to use Leela's NNs to give an output that matches human intuition regarding stuff like "king safety", "lead in development", "weak squares", etc?
* Can you use this output to create automatic annotations that provide insight to humans beyond: This is the best line and this is the evaluation of the resulting position?
* Language models like GTP-2 are getting extremely good at modelling text. There are roughly a billion online chess games availabe for free. Can you use this massive dataset to train a transformer model to play chess without ever having seen a chess board, just by learning from pgn?
* Can you distinguish between female and male players just by analysing their moves?
> 10 votes

# Answer
I am not a computer scientist. But I have been a chess computer enthusiast since the 1980's. My first engine was a tabletop Novag in about 1988. I read David Levy's book "how to get the most out of your chess computer".

The two traditional weaknesses in chess engines have always been \[1\] The horizon effect. David Levy describes it as being like a man in a maze who shines a torch at night. The man looks ahead and thinks that there is a clear path forward. But just past the "horizon" of vision the maze turns and has a dead end. Chess computers, like this dead end, see 8 moves ahead and think that they have a win. But 9 moves ahead they have a dead loss.

\[2\] Endgames. This is where \[1\] is most severe. Because to even a relative novice human player, we can see that a pawn will be pushed from its start square and make a queen and win the game. But to early chess computers that was far too many moves to see that!! Early chess computers struggled to win even totally won endgames.

Now, obviously in 2019 engines like Fritz and Stockfish and Alphazero manage \[1\] and \[2\] much better than my 1980's Novag. Levy's horizon effect is a bit dated. But it still applies. A few weeks ago I used it to beat an engine. I tricked the engine into thinking that it was rook ahead. But at my leisure I could over 20 moves get the material back easily and have a won endgame. The engine was probably about 2000ish.

If I had to suggest any Phd on machine learning and chess, I'd like to see one done on the endgame. Instead of filling the engine with huge endgame tables, what about taking classic endgame themes in Fine's Basic chess endings and conducting machine learning? A Lucena endgame for instance. Or some classic endgames from World Championship matches? Or endings with a million checks such as queen and pawn endings? I sincerely believe that there is a lot of new ground in endgames. I don't think for a moment that machine or human learning has covered everything in chess; endgames don't get the degree of attention that openings or middlegames get. Ideas in endgames have also developed. Steintz made it look like a pawn majority closer to the king was enough to have a won endgame. Alekhine showed that wasn't necessarily the case if you had other dynamic factors.

I'd be interested in seeing how you go! I like the previous suggestion of trying to realistically imitate weaker human play rather like a Turing test. I've noticed that with engines; they make weak moves that a human wouldn't make when set to a lower level.
> 6 votes

# Answer
### Feasibility of non-search based approaches

I'm going to talk about the feasibility of using a non-search based approach. Immediately, some questions that come to mind:

1. Does there exist a good `static_eval` function that takes a `(Position, PlayerTurn)` and returns some `Score`? ¹
2. Small changes in positions can often lead to massive differences in evaluation.
3. Search is not solely used by chess engines. **Humans extensively use search too**, albeit for a far smaller amount of nodes.

In theory, any large enough model (e.g. with some multiple of 6^64 parameters) can exactly represent a function `perfect_eval : (Position, PlayerTurn) -> {Win, Loss, Draw}`. But we only have access to finite space and time, so we desire a function `static_eval : (Position, PlayerTurn) -> Score` instead. Your proposed formulation `cnn_eval : (Position, PlayerTurn) -> Move` is roughly the same, but without having to choose the `argmax` of candidate moves in a position. However, it's a bit easier to talk about how `static_eval` behaves, so I'll stick with that for the rest of this answer.

Let's say we've managed to find ourselves a good `static_eval` function. Consider *all moves* in this position:

```
3qr1k1/1b1rbp2/p2p2p1/1p1np3/4P3/P2BB2Q/1PP3PP/4RR1K w - - 0 22

1. Rxf7 Kxf7 2. Qh7+ Ke6 3. exd5+ Kxd5 4. Be4+ Kxe4 5. Qf7 Bf6 6. Bd2+ Kd4 7. Be3+ Ke4 8. Qb3 Kf5 9. Rf1+ Kg4 10. Qd3 Bxg2+ 11. Kxg2 Qa8+ 12. Kg1 Bg5 13. Qe2+ Kh4 14. Bf2+ Kh3 15. Be1 1-0

```

Most of the moves are terrible, right? (b4, a5, Qe6, ...) So clearly, small deviations in its input `Position` should result in big differences in its evaluation. But this means that the "surface" that `static_eval` represents is very, very bumpy. This is fine if there's a structure to that bumpiness, preferably one that can be represented within our space and time constraints. Personally, I think chess is complex enough and the surface too bumpy that modelling it with our very limited space constraints is going to be very challenging. In the above position, the obvious move is to regain material with exd5. But as Wei Yi shows, if you search sufficiently deep, you'll realize that Rxf7 is winning.

I think another argument against an approach which does not consider a search tree is that humans themselves can take a quick glance at a position and change their minds after some calculation. In the following following position, it is easy to assume that black is winning due to his many threats. But after discovering a simple tactical sequence (starting with Qxf8+), it's clear that white mates in 4.

```
5rk1/3R1p1p/2p2p2/1q2nB2/5B2/QP3nP1/4rP1P/R4K2 w - - 2 34

```

### Another idea

So if search is so important, why can human grandmasters play reasonably correct games being limited in the number of nodes they consider? Human "static evaluations" might be far more time-intensive, but they are typically far more useful than the static evaluations performed by traditional chess engines. There is a tradeoff in evaluation time and accuracy, and until recently, chess engines have significantly preferred low evaluation times in order to search the most nodes they can.

As @konsolas puts it,

> Neural networks operate much more slowly than handcrafted evaluation functions. In the TCEC Superfinal, Leela Chess Zero, running on two GPUs each with dedicated tensor cores, is able to search around 60 thousand positions per second. By contrast, Stockfish, on a single core on my PC, searches over 2 million positions per second.

I think a more fruitful endeavor than completely abandoning search is to experiment with more expensive evaluation methods, but with a smaller number of nodes traversed.

More interesting ideas that people have tried can be found here.

---

¹ Naturally, one also needs to input a `State` parameter to handle rules like castling, en passant, and 50-move rule.
> 5 votes

# Answer
A couple of ideas:

1. Does chess help kids do better in school? That question has long been debated.
2. Do certain businesses with chess players, especially strong chess players, have an advantage in certain types of business, like finance?
> 4 votes

# Answer
Have you considered something like general game play? If you can train an AI to be good at both chess and other board based games (with the same network) you could show some interesting results.

This paper explores that concept for MCTS

This article explores the concept in RL.
> 4 votes

# Answer
I think a cool project which mixes chess and machine learning is to build a chess bot for 4 players chess. Such variant can be played on chess.com and if I remember correctly, they don't have particularly strong bots at the moment. Probably the most fun would be to use reinforcement learning and let the bot learn by playing against human players on the website.
> 3 votes

---
Tags: analysis, learning
---


# Question
Title: Kasparov's Immortal: Why didn't he play 10.Qg7?
Ok, I'm looking at Kasparov's Immortal to try to improve my own. I'm "mediocre" at best, but I enjoy a good game of chess.

At the end of the 9th move by both players, Kasparov has his queen on Qh6.

Now, I'm what would be called a "beginning" chess player, in that I like the game, but I'm not that good at it, even though I have been playing (though not professionally or really competitively) for years.

But my question is as follows: For Kasparov's 10th move, he moves a3. What would have been the ramifications of him making the move Qg7? It seems to me like that would set up a good capturing opportunity, or at least cause Topalov to move the rook to a different protective position, like Rf8.

```
[FEN ""]
[Event "Hoogovens Group A"]
[Site "Wijk aan Zee NED"]
[Date "1999.01.20"]
[EventDate "1999.01.16"]
[Round "4"]
[Result "1-0"]
[White "Garry Kasparov"]
[Black "Veselin Topalov"]
[ECO "B07"]
[WhiteElo "2812"]
[BlackElo "2700"]
[PlyCount "87"]
[startply "19"]

1. e4 d6 2. d4 Nf6 3. Nc3 g6 4. Be3 Bg7 5. Qd2 c6 6. f3 b5 7. Nge2 Nbd7 8. Bh6 Bxh6 9. Qxh6 Bb7 10. a3 (10. Qg7?) e5 11. O-O-O Qe7 12. Kb1 a6 13. Nc1 O-O-O 14. Nb3 exd4 15. Rxd4 c5 16. Rd1 Nb6 17. g3 Kb8 18. Na5 Ba8 19. Bh3 d5 20. Qf4+ Ka7 21. Rhe1 d4 22. Nd5 Nbxd5 23. exd5 Qd6 24. Rxd4 cxd4 25. Re7+ Kb6 26. Qxd4+ Kxa5 27. b4+ Ka4 28. Qc3 Qxd5 29. Ra7 Bb7 30. Rxb7 Qc4 31. Qxf6 Kxa3 32. Qxa6+ Kxb4 33. c3+ Kxc3 34. Qa1+ Kd2 35. Qb2+ Kd1 36. Bf1 Rd2 37. Rd7 Rxd7 38. Bxc4 bxc4 39. Qxh8 Rd3 40. Qa8 c3 41. Qa4+ Ke1 42. f4 f5 43. Kc1 Rd2 44. Qa7 1-0

```

Hey, he's the grandmaster and I'm not, I'm just wondering what might have happened had he made that move instead of a3. Mainly, how the game might have unfolded, and what Topolov's counter may have been.

# Answer
> 8 votes
> What would have been the ramifications of him making the move Qg7?

That would be a really bad move. In a heartbeat his opponent would play Rg8 threatening to take the queen. The rook is protected by the knight on f6. The only move the queen has is to go back to h6 and then it is Topalov's move. All white has done is give away a tempo.

# Answer
> 5 votes
As mentioned in the other answers, the move 10. Qg7 will lose a tempo. The only advantage that such a move could give is the following: this forces the rook to move and prevents the castle for the remaining of the game. But here, the Queen in h6 already prevents the castle and there is no immediate option to force the Queen to move. To sum up, for 10. Qg7:

* Advantage: the Blacks cannot castle anymore.
* Inconvenient: loss of a tempo.

And we have seen that the advantage is not a real one.

# Answer
> 3 votes
The first thing to do is to look at the characteristics of the position rather than looking for the best move. The more you play the easier this gets. My first reaction is "white's position has its problems": the knight at e2 blocks white's bishop, and white's queen has done a lone ranger job when it would be better on d2; on d2 the queen would be acting like the dark squared bishop that white has not got.

None of those problems are huge. But they do mean that white has to be careful. Thus my intuition would make me as white reluctant to move the queen again by playing Qg7. Qg7 just gives black what black wants; white wastes a move with the queen and stopping black castling on the kingside doesn't achieve that much for white. Black isn't in any immediate danger with a king in the centre. Black will just go...b4, the knight has no good squares to move to from c3, and then black can go..Ba6 or..Qa5 and I even prefer black slightly then.

I like Kasparov's 10.a3 to prevent ..b4. I also would have looked at 10.Ng3 , unblocking white's bishop and making a later..Ba6 not possible. 10.Qd2 is also worth a look; it's a least a better move than 10 Qg7?!

---
Tags: strategy, learning, kasparov
---


title: Playing d5 in the Pirc defense

text:
# Question
Title: Playing d5 in the Pirc defense
Two days ago, I played, a game as Black and after the analysis I was quite surprised to see that the computer suggested, in several moves throughtout the game, the move d5. In this position I think Black should develop first with g6 (what I played) and solve the situation in the center later.

I think the justification for this move is that it dismantles White center but I am not sure why it should not wait until later in the game.

As Black, I always try to keep a pawn on e5 (in this case) on c5. Can someone confirm this and explain me the Pirc Defense idea behind this?

Thanks in advance.

# Answer
In most early-stage Pircs, black is slightly worse, so of course, the computer will prefer any move that equalizes, or in this case, gives you a slight advantage.

White is not well-placed in the center due to the pin on the Nf3, and the Bd3 interferes with the Qd1's protection of the center (d4) too. Black can effectively "blow-up" the center here, which leaves him at least equal.

It comes down to specific tactics here, and d5 works. If you wait, white may play d5, and your opportunity would be lost.

One more note: I do not play e4, so I don't think about this much, but in many e4 openings, black wants to get in the equalizing d5, thus you don't usually see the bishop on d3 since it makes d5 easier to achieve. It is usually on e2, c4, or b5, so Bd3 was probably not best. In d4 openings, which I play, Bd3 is common, but black already has d5 in, so it is fine.

```
  [FEN ""]

  1. e4 d6 2. d4 Nf6 3. Bd3 e5 4. c3 Bg4 5. Nf3 Nc6 6. Be3 d5 7. Nbd2 (7. exd5 Qxd5 {The black queen is now well-placed, and threatens e4.}) 7... dxe4 8. Nxe4 exd4 9. cxd4 Nxe4 10. Bxe4 Bb4+ 11. Kf1 $15

```
> 5 votes

# Answer
Playing ...d5 isn't your typical Pirc idea, although it can be played under the right circumstances. In the diagram, White's d3-bishop and f3-knight are vulnerable to a potential ...e4 push. In addition, your g4-bishop provides some tactical possibilities by pinning the knight. Concretely speaking, everything just works nicely for an immediate challenge in the centre. It's not so much that ...d5 is a "Pirc move", but rather that it just works well in this particular position.

You are correct that normally you wouldn't play like this so early on in the Pirc, but one must always adapt if the position calls for it (in any opening). Also, with the bishop on g4 you won't really be able to get a satisfactory Pirc position by playing normally anyway. In both the Pirc and King's Indian type structures, it's very important for Black to retain his light-squared bishop (in order to fight for the weakened light-squared complex). If White is given control over the light squares so early on, you'll be facing an upward struggle.
> 5 votes

---
Tags: analysis, strategy, pirc-defense
---


title: Weakening g4 move

text:
# Question
Title: Weakening g4 move
I would like to know the reason behind the very weakening move g4 recommended by Stockfish in this position:

# Answer
Well, I am amazed. I thought that it would be another case of a free online engine just not being that strong, but my Stockfish, and Deep Rybka, both like g4 there.

I know I would never have played that move in a million years since the eval is very close to other more normal moves like Re1, but here is what it sees.

It thinks that you can get in g5 when h5 is forced since hg loses by force, and you cannot allow gh there. After h5, that pawn becomes weak and will be lost. As you force in even just a few moves the computer thinks is best, the eval continues to grow, and it leads to a won position almost by force.

There are, of course, many other tries, but they also lead nowhere for black.

```
  [FEN ""]

  1. d4 h6 2. c4 e6 3. e4 Bb4+ 4. Nc3 Ne7 5. Nf3 Ng6 6. Bd3 O-O 7. O-O Bxc3 8. bxc3 b6 9. g4 c5 10. g5 h5 (10... hxg5 11. Nxg5 $18) 11. Ne1 d5 (11... h4 $2 12. f4 $18) 12. cxd5 exd5 13. Qxh5 $18 Nc6 14. f4 {and you can see that black is lost.}

```
> 6 votes

# Answer
White has a wealth of factors working to his advantage:

* A lead in development.
* A massive centre.
* Having control over the dark squares.

These factors allow him to get away with pushing g4. Sure, it weakens the f4- and h4-squares, but his dark-squared bishop can defend them (and Black lacks a dark-squared bishop of his own). There's also the fact that the h6-pawn acts as a hook. If the game continues g5 hxg5 Bxg5, both sides' kingsides have been opened a bit. Then, White could use the g-file with Kh1-Rg1, and suddenly Black's king is actually in more danger than White's.

When one side has a number of advantages, there often comes a moment like this one where he can "cash in" and gain concrete results for it. What's the point of having a number of strategic advantages if they're never eventually used in an offensive manner?
> 3 votes

---
Tags: analysis, stockfish
---


title: Meeting d4-d6 from White's perspective

text:
# Question
Title: Meeting d4-d6 from White's perspective
How do you meet d4-d6 when your opponent ***doesn’t*** play the Old Indian, and the setup is d6-Nbd7-e5, which is Pirc territory?

```
[fen ""]

1. d4 d6 2. null Nd7 3. null e5

```

When this happens, can I play the London System, possibly with d4-Bf4, and so forth?

# Answer
> 2 votes
> When this happens, can I play the London System, possibly with d4-Bf4, and so forth?

Simple answer is "Yes, provided you play 3. Nf3"

```
[fen ""]

1. d4 d6 2. Bf4 Nd7 3. Nf3 e5 4. dxe5 dxe5 5. Nxe5

```

Just leaves black a pawn down for no compensation. So, black can't play 3 ... e5

# Answer
> 2 votes
I wouldn't recommend London against 1...d6 or 1...g6. They can do 1.d4 d6 2.Nf3 g6 3.Bf4 Bg7 4.e3 Nd7 5.h3 (or whatever) e5 which is if anything more comfortable for black imho. Black normally has to do some contortions such as Nfd7 to get e5 in whereas now he gets it in one go.

Play 2.e4 and learn some small amount of theory in one of the main lines (whichever suits your style best) - will give you a nice position without too much work. If opponent continues with Nbd7 etc. (Philidor) then you could choose between the sharp Shirov Gambit (1.d4 d6 2.e4 Nf6 3.Nc3 Nbd7 4.Nf3 e5 5.g4) or play positionally with 1.d4 d6 2.e4 Nf6 3.Nc3 Nbd7 4.Nf3 e5 5.Bc4 with ideas of 0-0,Re1 a4 Ba2 (prophylaxis against b5 and Nb6 and d5 ideas) and a small pull.

# Answer
> 2 votes
Planning to play the Old Indian (Be7 for black) against the London System has no bite since white can control e5 more easily. The Be7 does not aim at e5, of course, but as important, it inhibits Re8, and its control of e5 also. So minus two pieces helping play e5, and you are not likely to get that freeing move in. You would also have to play (after d6) e6 since e5 loses a pawn to any reasonable white development, Be7, and only then, figure out how to enforce e5 gaining some space in the center. In reality, you would probably have to play for c5 instead.

As a defense against the London System, the King's Indian (g6 and Bg7) is much more logical since the Bg7 can help fight for control of e5, and the Re8 immediately helps too with a potential e5. In those lines, white usually plays Bf4, but then h3, and Bh2 to anticipate black's eventual e5.

# Answer
> 1 votes
If you like playing the London system, then it is playable:

1.d4 d6 2.Nf3 Nd7 3.Bf4. Now if Black plays 3...g6 then you just go for 4.e3, 5.h3, 6.Be2, etc. And as Brian noted, 3...e5 is poor.

However, if you don't like the London then you need another line. If you want to remain completely in d4 waters then you could go for:

1.d4 d6 2.Nf3 Nd7 3.c4 e5 4.Nc3. Now against most moves Black can play (4...Nf6, 4...g6, 4...c6, etc) you just play 5.e4. And on 4...exd4, you recapture with 5.Nxd4 and then fianchetto with 6.g3.

---
Tags: london-system, pirc-defense, old-indian
---


title: Could a chess engine do retro analysis?

text:
# Question
Title: Could a chess engine do retro analysis?
If I took a legal chess position, to what extent could an engine work out the previous moves? \[in some other board games such as Othello such game reconstruction is done easily with an engine.\]

# Answer
Engines like Stockfish and Komodo are not able to work out the previous moves, because that is not what they are programmed for.

However, it is vanishingly unlikely that anybody can ever program an engine that works out legal previous moves. The logic of working out whether a possible previous move is legal or not is extremely difficult.

To start with, **how do we list possible previous moves?**

Possible previous moves, called retractions (if we ignore legality for a second) are easily found algorithmically - every piece retracts as it moves in forward chess (except pawns), and they could also "uncapture" an enemy unit - pawn, knight, bishop, rook or queen. e.g. wBc4 takes pawn on f7 in reverse looks like the bishop moving from f7 to c4, with a black pawn appearing on f7.

Pawns move 1 square backwards, and uncapture one square diagonally backwards. (You can figure out what the double step looks like.)

With regard to checks, one can retract into what looks like "check" in regular chess, and one must always retract to never leave the opponent in "check". (So if the previous example of wBc4xbPf7 checks the black king on e8, it required white to retract the bishop to remove the "check".)

Uncastling is easy to visualise (and adds the constraint that the king or rook cannot retract again). Un-en-passant is hard to describe and forms the basis of many classic retro problems. Unpromotion is again easy to visualise.

So listing all potential retractions is not difficult, from a programming standpoint. **The incredibly difficult part is determining which retractions are legal.** There are many reasons why a retraction cannot be legal, ranging from simple (retracting an uncapture to leave 9 black pawns on the board, for instance) to highly convoluted (cf. most retrograde analysis problems, see the Retro corner.)

See for instance this problem by Troitsky on Chess.SE, and my accompanying answer to it. A lot of logic goes into proving that there is in fact only one legal retraction by black, and this is not obvious, involving counting pawn captures, considering their order, and tempo constraints.

To write an engine to perform such a task, one must be able to elucidate the human logic behind it in such a way that a computer can execute the logic. This simply does not seem possible at all, given that "legality of retractions" is far more nebulous than "legality of forward chess moves".
> 16 votes

# Answer
Current engines can't do this at all. Calculating backwards is quite different from calculating forward. Pieces come into existence instead of being taken.

But you could certainly adapt engines to be able to perform well on this task.
> 6 votes

# Answer
I’ve decided to expand this to a more general survey of the applicability of engines to various retro sub-genres.

Chess engines (e.g. Stockfish) are good at trying out all the moves going forward in a position but famously bad at abstracting general features such as fortresses.

In the same way you can easily try retracting possible least moves just by making pieces move backwards, hatch opposing pieces instead of capturing them, and run away from opposing kings that are “checking” them. The difficulty is in abstracting general features to find out whether the position can be derived from the starting position. The distinction between legal moves and legal positions is the key here and is a distinction made in the FIDE Laws as well.

**Proof games** One retro domain that has enjoyed great success with engines is proof games. These are like retro problems except that you’ve been given the additional information of the expect number of moves. This notion of clock simplifies the retro process enormously, in a similar way that Othello games can be deduced because one knows the exact number of moves. Some people regard them as forward stipulations because you do start from the game array and can play forwards, but they are generally viewed as retros. Leading engines in this space are Natch, Euclide, Popeye and for fairy problems Jacobi.

**General retros** There are fewer engines for general retro problems. These work by allowing the solver to specify constraints that are deduced by a human solver. Jacobi does this within the envelope of some notional number of moves, but the best I know is the enigmatic Rawbats, a tool only used by its maker Mario Richter, and known only by its results in augmenting its developer’s skills.

**Helpmate retractors** There is a big opportunity for someone computerate to build a simple retraction engine which just tries retracting recent moves, without worrying about global legality, and then plays forwards like a regular problem engine. Such an engine, combined with a little human common sense, would be able to validate the hundreds of helpmate retractor compositions which are currently untestable.

I want to finish by mentioning two retros areas which are less amenable to engine assault.

**Problems based on conventions** One is the domain of retro conventions: castling, en passant and other related rules. Combining a logical reasoning system with a chess engine has not been done, and in some cases there are deep ambiguities in the conventions themselves. This work is normally left for the human to solve, but in principle if the conventions could be grounded logically, it would be an interesting research topic.

**Defensive retractors** The other difficult genre of retro composition contains the highly technical defensive detractors of various kinds. These essentially involve playing chess backwards in a competitive way, and questions of position legality are normally the key without which the problems compositions make little sense.
> 6 votes

# Answer
Basically, the answer is "no", and that will probably never change.

I am going to compare this to tablebases since it seems relevant due to how they are made compared to what you ask in your question. I realize they are different in certain other aspects.

Tablebases, which are databases of perfect endgame play, are computed in exactly that way that you are asking: They start at the final position, and work back to the possible original position. Of course, they start from the end of the game when there are only currently 7 pieces, or less, left on the board, including kings. You can see how this is actually is MUCH easier than your question, yet it is still a HUGE undertaking for computing power as we currently know it.

With only 7 pieces, it not only takes an incredible amount of time to solve even one position, and it takes a WHOPPING 140+ terabytes to store all 7-man tablebases. It took years to do this. You can see how adding even a few more pieces, this grows exponentially. Due to the extreme computing-power cost, we are not even close to starting 8-man tablebases, and it is estimated that they would take over 10 petabytes to store in their entirety. Even though you are not trying to solve every position with 32 pieces, you can see how trying to go from the end of a game back to the original 32-piece starting position is not feasible.

The only question is if could they program in the human tendency to play in various ways to prune the search, but I doubt that very much, as even then, the numbers are huge.
> 6 votes

# Answer
No.

First and foremost, engines (and everybody) play against some other also (an human player, another engine, even themselves with the opposing color). They may *guess* the probable move(s) of the other actor, but they do not get too far. They pick a good move and the other actor's move helps them to narrow the range of possibilities.

Reversing a game position is a different problem, as you need to *know* both players moves to solve it. You do not know if the moves were good or bad, or even if they made sense, you only know that they were legal. In that sense, rebuilding the game would be more akin to "solving" chess (getting all possible solutions of a game from the start position).

Additionally, even if you strengthen the requirements ("let's guess that each player always played the move with the best analisis by the current engine") you have lots of situations where several possible predecessor states do appear. Just guess

```
rnbqkbnr/pp1p1ppp/8/8/3p/N7/PPP1PPPP/R1B1KBNR w - - 1 13

```

Does this come from?

```
[fen ""]

1. d3 c5 2. d4 e5 3. Na3 exd4 4. Qxd4 cxd4

```

Or from?

```
[fen ""]

1. d3 c5 2. d4 e5 3. Na3 cxd4 4. Qxd4 exd4

```

In both cases black's last move is its the strongest one, yet it does not serve you to decide which was the previous board situation. As the analysis expands backwards, the possibilities multiply.
> 4 votes

# Answer
As others have said, current engines are not meant to do that. But from a theoretical computer science perspective, it is "possible", although likely unfeasible.

Just like a "forward" chess engine can search at most a few (dozens?) moves in the future (because the possibilities explodes exponentially), a backwards engine would suffer from the exact same limitation.

I think enumerating all legal backwards move from a given board state is relatively simple (contrary to what others have said), but the number of possibilities explodes exponentially the farther back we go.

Anyway, since the number of board states is finite, it is theoretically "possible" to write such a program: given enough time, a computer will analyze every possible state and eventually concludes with a valid game up to that point (it is non-unique; many games can lead to the same state), or conclude that such position is impossible (even if it takes many times the age of the universe to get there, hence the quotes on "possible"). This is what we computer scientists call a decidable problem. Such approach is probably not feasible (as it is certainly not feasible for "forward chess").

But modern chess engines does not blindly enumerates every possibility. Instead they use very advanced heuristics to decide the likelihood of a movement, and they perform very well against humans. It seems to me that similar heuristics and techniques can be used to create a backwards game of chess in a software that works at least sometimes.
> 3 votes

# Answer
It's true that starting from the target position, searching for possible previous moves will probably be infeasible. However, there is an approach that could yield a reasonable game that hits the target position.

In normal chess engines, the computer scores each position with some criteria, such as how many pieces it has remaining. The purpose of the score is to decide how likely it is to win from that position.

One could instead use a different set of scoring criteria, such as how many pieces are in correct places, and whether the set of remaining pieces matches the target.

Placing two such engines playing a normal forwards-game against each other could probably generate a game that ends up in the target position.

**Extra:** A fun extension would be to use the normal scoring for predicting opponent's moves and the target scoring for chess engine's own moves. This way the plays-for-target chess engine would try to force a plays-for-win opponent to end up in the specific position. Of course this would only be possible for a small subset of positions.
> 3 votes

# Answer
While it might not be currently possible to write an AI that does better than humans, there are some relevant programs under the "retro, programy, úlohy" subheading here
> 2 votes

# Answer
From the pure theoretical point of view: Yes, it is possible.

You just need to play forward all possible games until you find at least one game that contains the current position. Then you use the moves it played forward to do your retro analysis.

But you cannot **just** do it, as the amount of possible games is huge. So this point is only a proof, that it is possible in theory. In practice, the question is if it is tractable in a reasonable time.

I suppose it is tractable by extending some of the current planning methods, but the details are not straightforward. I would recommend asking the question if an AI can achieve this at https://ai.stackexchange.com, as it is an interesting question about game AIs and may spark some quite interesting answers on that site.
> 1 votes

---
Tags: engines, retrograde-analysis
---


# Question
Title: What is the most amazing chess position you have seen?
What is the most amazing chess position you have seen?

I have been wanting to ask this question for a while, but feared it would be closed. Since the "Uniquely Satisfying Puzzle" and "What is the most complex chess problem?" questions were not closed, I am going to post it. I hope that this is not voted closed as it is a chance to share some amazing positions.

Please post only one position per answer, but feel free to answer multiple times.

# Answer
White to win. L Kubbel 1927

```
 [FEN "8/8/1p6/kp3p2/p7/1PP1p2B/5p2/5R1K w - - 0 1"]

 1. Ra1 $1 {Threatening Bf1 stopping the pawns.} e2 2. Bf1 $1 e1=Q 3. Rxa4+! bxa4 4. b4#

```
> 6 votes

# Answer
And one last one from a real game. Black to move and win.

```
 [Date "2003.??.??"]
 [White "Ibrahim"]
 [Black "Ibarra"]
 [FEN "3q4/1p1n1pk1/p1r1p1p1/2P1Pn1p/1P1N1P2/B5rP/5RPK/Q3R3 b - - 0 1"]

 1... Nxd4 $1 2. Kxg3 (2. Qxd4 Rxa3 3. Rd1 Qh4 {is just up a piece.}) 2... Qh4+ $3 3. Kxh4 Nf5+ 4. Kg5 Nf8 5. g4 {and there is no defense to....} Nh7#

```
> 6 votes

# Answer
A missed variation from the game Najer-Nepomniachi, Moscow 2006. Black to move and win.

```
 [FEN "5rk1/3R1p2/4p2p/4P1pP/2q4r/P1n1BQ2/2P2PP1/4R1K1 b - - 0 1"]

 1... g4 2. Qg3 Qf1+ $3 3. Rxf1 (3. Kxf1 Rh1#) 3... Ne2#

```
> 4 votes

# Answer
White to move and draw. Y. Afek 1978

```
 [FEN "8/5N1p/8/b6p/7P/6KP/7R/4kr2 w - - 0 1"]

 1. Ne5 $1 {Rf7 and Bc7 are both threatened.} Bc7 2. Rh1 $3 Rxh1 (2... Bxe5+ 3. Kg2 Rxh1 4. Kxh1 {And while black is up a piece, and can win all of white's pawns, this is a known drawn position since the white king cannot be ousted from the corner of the "wrong" bishop.}) 3. Kg2 Rf1 4. Nd3+ $1 Ke2 5. Nc1+ $1 Ke1 6. Nd3+ Ke2 7. Nc1+ Rxc1 {Stalemate!!}

```
> 1 votes

---
Tags: analysis, tactics, studies
---


# Question
Title: How to make a self study plan to become a good chess player to play rated tournaments?
I am a programmer and a chess player who knows the moves and the basic rules but never played professionally. I am a complete novice. I tried in FICS and failed to win a single match. I was playing regularly around 15 years back and want to start again.

I was searching here and there to make a plan to become a pro. I am interested more in self study. So the books these sites are referring are a little confusing for me. As some claiming book X to read first and have their reason while some claiming to read book X after other 5 books and showing there own reason.

I want to know how I can make a solid one-year self-study plan that can polish my skills to start playing well in any rated tournaments. How can I make a reading list for chess? Yes I want to improve my chess to a particular level before entitling myself for clubs or rated tournaments and want to do it myself. Below are some of the questions that are coming in my mind, please let me know the points that I missed.

1. How to make a daily plan for opening, middle game and end games?
2. How to make a reading list that can be suitable for me.
3. How to select a chess engine?
4. What other things I need like a notebook to write my chess moves?
5. How to make a plan to practice tactics.
6. What else I need to do to train myself without a coach? (I can use internet and books instead of coach)

Thanks in advance.

# Answer
**1) How to make a daily plan for opening, middle game and end games?**

Make the balance proportional. Many novice players come out of book opening before move 5, so don't go overboard on learning openings by rote. Picking up on this, analysing whole, annotated games is of benefit, as you see all phases of the game.

Potential sources:

* *Logical Chess: Move by Move: Every Move Explained* by Irving Chernev
* *The World's Most Instructive Amateur Game Book* by Dan Heisman
* *The Mammoth Book of the World's Greatest Chess Games* by Graham Burgess and John Emms

**2) How to make a reading list that can be suitable for me.**

Throughout this answer, I give potential sources to look up. Remember that you only get out of chess what you put in, so get the resources that appeal to you the most and study them. This is what you should look for:

* Plenty of diagrams
* Not many variations, but ideas expressed in words mostly. If there are variations, they should be short (3 moves or less would be a good rule of thumb)
* Written in a way that engages you. Read a preview and review online of the book before you buy

Remember that books are one thing, but YouTube videos are useful too. Check out the channels by Dereque Kelly for openings and the Chess.com channel.

**3) How to select a chess engine?**

Any software with lots of tutorials and player personalities of various strengths and temperaments will be fine. Don't move on from a tutorial section until you really understand it - moving onto the advance content too soon will only confuse you.

I would recommend Ubisoft's *Chessmaster* (as I always do, if you read any of my other answers)

**4) What other things I need like a notebook to write my chess moves?**

For tournament play you should take:

* A pen
* Back up notebook (they are usually provided)
* Something to eat and drink between rounds. Chocolate is good - its the closest equivalent to steroids in chess
* Suitable clothing. If you live in the UK like I do, a spare jumper is a must

For training with a book, I would recommend a:

* Chessboard and pieces similar to the ones you will be playing with in the tournament, as moving the pieces helps recall and learning. Most tournament chessboards I've come across are vinyl with white and green squares. Chess pieces are Staunton style, King size at about 2.5 inches
* A document stand, so that you don't need to use one hand to hold the book all the time
* A piece of card to cover up answers with. As a general hint, whenever you are working with a book and you see a new diagram, try to work out the best move for the player, then compare your answer to what was played
* Notepad and pen. Learn to play the move, then write the move down, as chess etiquette is highly ritualised and is written in the rule book. You don't want a picky opponent to cause trouble this way
* I would advise getting a chess clock unless you know what type is being used, as it will not be used much if you are studying mostly solo. But some people advocate getting one to get used to the controls and the background ticking

**5) How to make a plan to practice tactics.**

Get any beginner tactic book and solve the problems in dead time (on the train, whilst you are waiting dinner to cook, during your lunch break etc.) and solve the problems. Resource suggestions are:

* *Back to Basics: Tactics* by Dan Heisman
* *Winning Chess Tactics* by Yasser Seirawan
* *Chess Tactics for Kids* by Murray Chandler (don't be put off by the title! In general, chess books written for a younger audience are written in a more engaging way than they are for adults, and with just as good content too)
* ChessTempo.com

**6) What else I need to do to train myself without a coach? (I can use internet and books instead of coach)**

Nothing else, but conduct a post-mortem after the tournament game if your opponent is willing. this is where you discuss the game and understand which moves made your opponent uncomfortable and where you erred. Also, you can post the game on Chess.SE and ask for feedback.

This answer is also based on what I've learnt from *Studying Chess Made Easy* by Andy Soltis. At the end of the day, you will only take the material in if it is fun and relevant. There is nothing more frustrating than learning a lot of chess material at the end of a hard day's work, then getting beaten in tournament play over and over again. If this happens, try entering tournaments that are more at your level, or joining a friendly chess club.
> 10 votes

# Answer
Forget about becoming a professional. Do you know how many grandmasters there are that are working at minimum wage?

Play for fun instead. You need to learn one opening really well and learn tactics along with playing endgames. Later, you can focus on pawn structures and positional play.

There are some other esoteric subjects but until you are GM level they won't help you.

I wouldn't recommend playing blitz or speed chess slower than G15 until you are ready to plateau. But do not play super slow tournaments either, as G30 should be the slowest you play.

The best practice is the old way, which is exactly ten seconds per move. No more no less! Start at 15 or 20 seconds at first if ten is too fast. That forces you to take enough time to see the board and make a sensible move. You will do so much better in time trouble with that practice.
> 2 votes

---
Tags: learning, beginner, study, coach
---


title: Learning chess theory

text:
# Question
Title: Learning chess theory
I have played a lot of chess in my childhood. And I'm quite a decent player as well. However I stopped playing for few years now. Only after I realized that there are lot of opening/middle/closing text book moves like 'kings Indian defense' etc. if I start fresh once again, how should I start learning these text book moves and implement it? There was no one to coach me in childhood so I never knew all this.

# Answer
When you state that you are quite a decent player, exactly what do you mean by that? Do you mean that you have been producing relatively good results in actual chess tournaments, or do you mean that you usually win when playing against casual players? If the first description fits you, then studying opening theory may bring some value. In this case, you should try to understand why the moves are played in the opening instead of just memorizing variations, as the latter won't prepare you if your opponent steps out of theory. Look at famous games played in the opening and reflect over the moves that are played. (Edit: And as r4 pointed out in his answer: don't be afraid to play the opening a lot!)

In the other case it will probably be completely pointless to study specific opening theory, as there are other things you need to learn first to become stronger. In this case it's better to review the basic opening principles about development, center control, piece activity and king safety, and follow them. In the vast majority of cases they are sound enough to give you an advantage against weaker tournament players, if you master them.
> 4 votes

# Answer
Learning by doing. This is how the mind works. Play a lot. Practice tactics about an hour every day at http://chesstempo.com/chess-tactics.html

Two extremists which I notice a lot. 1. The beginner plays too cautious. 2. The beginner plays too aggressive (king's gambit). As for openings. Forget it until you are more experienced. In your shoes I would probably play the London system as white and perhaps the Dutch stonewall as black against d4 and classically 1.e4e5. (Further explanation of openings is beyond the scope of this question). For openings I often use game collections at www.chessgames.com.

Speaking from experience I find that my play improves from physical exercise.

I want to address the advice from Scounged in his comment.

I myself have been studying the opening a lot from the very beginning. I played the Kings Indian and the Najdorf combined with 1.e4 main lines. But my tactics skills where lacking. Also, I walked in to unfamiliar positions all the time. Nothing particular bad with that, but, they were familiar to my opponents, giving me a vey hard time. Then I changed my repertoire. Then I changed my repertoire again. Clearly, what I should have done is to play 1.g3 or similar in all my games and focusing on tactics and ideas.

Unless your opponent also knows and are willing to play the main lines the positions you have been studying are not likely to come up in your games. My feeling is that opening books are addictive (to me) and is great for giving motivation (perhaps also memory training). Giving that 3 world champions reached the top without playing main lines I stand firm in the no opening theory section. The world champions are Alekhine, Capablanca and Carlsen. I do think they know the openings ins and outs and the principle behind them, however. Perhaps a middle road is better for some, but I don't think it's effective at all.

When you have reached a certain level the endgame is of outmost importance. Many coaches with ambitions students teach the endgames first. Endgames are considered the hardest part of chess.

One suggestion for a rather solid game is to play 1.d4 and the London system. When you have mastered tactics (several hundred hours) and are bored of London you go on with 1.d4 2.Nf3 3.c4 and 1.d4 2.c4.
> 3 votes

# Answer
> One doubt is that... If I study one opening ... For eg... Ruy Lopez... But opponent plays something different... Then I can't continue with ruy Lopez system... So is there like a bunch of opening system which you find it useful? Which I can read

One relatively quick solution would be to select a repertoire where your opponent's choices are restricted and you can follow some kind of formula to get your pieces developed.

One example would be to play the King's Indian Attack as white and the King's Indian Defence / Modern as black. That way you drastically limit what you need to learn and over time you will find that you become more and more familiar with the positions and plans that come out of these openings and so you should be able to get good results and avoid unpleasant surprises in the opening.

I'm not suggesting that this would be a particularly exciting approach just that it would be effective. I believe there have been quite strong players (IM / weak GM standard) in the past who have adopted this kind of strategy. It is not one I would recommend to a junior (school age) player since they have the time to study more widely and become a more rounded player.
> 1 votes

# Answer
If you want to improve focus on ONE opening, don't try to learn many of them, especially if totally different styles.

You need to learn how to play endgames and tactics as well.

If you get over an 1800 FIDE rating add advanced things like pawn structures and positional play.
> 1 votes

---
Tags: analysis, learning, theory
---