As always, everything that is on this blog is free, including my ideas. If anyone wants to implement it, I am not asking for anything, although a little credit would be nice. It might already be out there, for all I know.

  This is a game idea. It's a multiplayer game of chess, assisted by computer engines. The interface is a chess board and a number of button choices holding the best N moves as found by a chess engine. Possibly the choice of opening should be slightly different, but the MVP product is just that: computer suggests N moves and player choses one. Making a choice will show the move on the screen, tapping the button again will send it to the server.

  It would be a more casual way of playing chess. Moreover, it would train players to choose between candidate moves, which is a secondary skill. The more difficult part of playing chess is finding candidate moves and usually most effort goes into it. This way, the computer takes care of that and lets the player focus on learning how to spot the better move.

  The advantage for the game builder is that they get a database of how humans (at specific levels) select the moves. Next step is to create an AI that can consistently choose between candidates just as a human would. This can then be added to any existing chess game to provide a more human feel, regardless of the underlying chess engine.

  The game could be played against the computer from the very beginning, by altering the probability to choose between top moves based on the supposed chess level. At maximum level the best move will always get selected, while at lowest level the choice will be completely random (but still pretty good, because it will only choose between top N moves).

  Choosing the opening from a list by name could also be interesting, and showing the player the most common replies and what the plan is. Perhaps the number of candidate moves could be a game parameter, so both players agree to play six candidate move game, but others would go for three.

  The interface is simple enough for people to play it on any device, including with a remote on a Smart TVs or on small screen devices.

  Implementation should be relatively trivial. Open source chess engines like Stockfish are available for most major programming languages, including JavaScript. It is the interface that requires most work. Perhaps the possibilities for optimization are the most interesting, as development goes, having a cache of common positions and the top moves, for example.

  Drawbacks include not being able to follow a plan, assuming the computer doesn't give you the choice to move in a direction you worked for. Also, the computer analysis should be consistent over devices, not giving an advantage to more powerful ones. That means both players waiting for the amount of time that analysis takes on the slowest device on the same number of plys.

  There are single player game modes (training) that can be added:

  • play the best move - choose the best move from the four presented
  • find the top moves - a position is presented and the player must make the top moves. When a move is found, points are given. When a move is wrong, points are removed.
    • yes, this requires actually moving pieces, which would not be "on brand"
  • find the best pieces - pick the best piece for either player in equal positions 

and has 0 comments

  I was watching a chess game that started with e4 and Black responded with the Modern Defense. Black challenges the center with a c-pawn push, but then delays the capture and develops the knight, prompting White to chase it across the board. By the time the knight retreats to c6, there have been only three chess games that reached the position on Lichess, but none of them continued with the move recommended by Stockfish: Bxf7+

  The only reasonable move for Black is to take the bishop with the king, and after dxc5 from White, the Black knight is trapped! Only squares not covered by the White queen are either occupied by Black pieces or leading into a direct fork at Qd5+.

  I found this interesting because the computer suggested continuations are quite unintuitive, while the things that feel natural to me (not an expert, mind you) lead to huge gains for White. Also, it's a move that has never been played AFAIK.

  So, a long overdue chess post and some PGN: 

1. e4 g6 2. d4 Bg7 3. c3 c5 4. Be3 Nf6 5. e5 Nd5 6. Bc4 Nb6 (6. .. Nxe3 7. fxe3 d6 (7. .. O-O) 8. exd6 exd6 9. Nf3 d5 10. Bb3 O-O 11. O-O) 7. Bxf7+ Kxf7 8. dxc5 {Knight on b6 is now trapped. The only escape squares are covered by the White queen or leading to a fork at d5.} d6 (8. .. Nc4 9. Qd5+ Ke8 (9. .. e6 10. Qxc4 Rf8 11. h4) 10. Qxc4) (8. .. d5 9. cxb6 Bxe5 10. Nf3 Bf6 11. bxa7 Nc6) 9. cxb6 dxe5 10. Qf3+ Bf6 11. bxa7 Nc6 {It's not a huge advantage, but Black can't castle, has double pawns and the fianchetto bishop is a glorified pawn. White develops either knight and is just fine without both center pawns.} *

and has 0 comments

  Chess is a game. In order for something to be called a game, it must be fun, it must be tailored to the level of the players and sometimes, especially nowadays, it needs to be exciting to an audience.

  Now, chess engines are fantastic in respecting the rules of chess and mating the king in the quickest possible way, but it's not a game anymore, it's a process. Occasionally people watch what computer engines are doing and notice the beauty in some of the ideas, but that beauty is coincidental, it has no value to the machine and "sparks no joy".

  I've been advocating for a while training chess engines on other values, like beauty or excitement, but those are hard to quantify. So here is a list of values that I thought would be great to train chess engines on:

  1. player rating
    • which is great because it's constrained in time, so if someone is a GM, but completely drunk and haven't been sleeping for a week, the engine would adapt for their play at that time
    • I know that engines have a manual level configuration, but I doubt it was ever correctly modelled as an input. Most of the time, a random move is chosen from the list of best moves, which is not what I am suggesting here at all
  2. value and risk of a move
    • I know this sounds like what engines are doing now, but they are actually minimizing risk, not maximizing value
    • We also have the player rating to take into account now, so the calculation changes with the player! A move that would be negative because another perfect computer chess engine would take advantage of a minute flaw means nothing now, because there is no way an 1800 rated human will see it. And if they do, what a boost in confidence when they win and what pleasure in witnessing the moment!
  3. balance risk with the probability of winning
    • this is the best part. Riskier moves are more fun, but can cause one to lose. Allow a probability of the other player missing a move, based on what we have calculated above. We are actually adding a value of disrespect from the engine. It attempts to win despite the moves it makes, not because of them.

  What I am modelling here is not a computer that plays perfect chess, but a chess streamer. They gambit, they try weird stuff, they do moves that look good because they can think of what the other player is or the audience are going to feel. They are min-maxing entertainment!

  A chess streamer is usually a guy around 2500 showing mercy and teaching when playing against lower rated players and trying entertaining strategies against equal or even better rated ones. They rate the level of a move, which is an essential metric on what strategies they are going to employ and what moves they are going to play. In other words, they are never considering a move without taking context into account.

  Imagine a normal chess engine, using min-max or neural networks to determine how to win the game. Against another computer, the valuation function is extremely important, since it limits the number of possible moves to one or two. Against a human noob, there are a lot of moves that will lead to a win. It is obvious that another metric is necessary to filter them out. That's how humans play!

  Short story shorter: use opponent rating to broaden the list of winning candidate moves, then filter them with a second metric that maximizes entertainment value.

and has 2 comments

In both these positions, White to move and mate in two moves. Can you spot them?

[SetUp "1"]
[FEN "2B5/K7/6p1/3QpNbb/4Pkp1/3P4/3PqP2/5RN1 w - - 0 1"]
1. Nd4 Qxf2 (1. .. Qf3 2. Ne6#) (1. .. Qe1 2. Ne6#) (1. .. Qe3 2. dxe3#)
(1. .. Bh6 2. Ne6#) (1. .. Qxe4 2. Qxe4#) (1. .. g3 2. Nh3#) 2. Ne2# *

[SetUp "1"]
[FEN "7b/3PKn2/1R2N1P1/1pr1k3/1N3p1Q/1pP1r2n/4pR2/BB6 w - - 0 1"]
1. Nd4 Nxf2 (1. .. Rcxc3 2. Ndc6#) (1. .. Rc8 2. Re6#) (1. .. f3 2. Re6#)
(1. .. Bf6+ 2. Qxf6#) (1. .. Nd8 2. Qxh8#) (1. .. Nfg5 2. Qxh8#) (1. ..
e1=Q 2. Re6#) (1. .. Rc6 2. Ndxc6#) 2. Re6# *


Here it is in video format:

[youtube:ueht7DBP5dc]

and has 0 comments
I have been playing a little with the Houdini chess engine and Chess Arena. I limit the ELO of the engine to a set value and then I try to beat it. It's not like playing a human being, but saves me the humiliation of being totally thrashed by another person :) Plus I didn't have Internet. In this case the ELO was set to 1400.

One of the games I played turned out to be extremely interesting (and short). Black tried the Elephant Gambit, to which I replied clumsily, but then it made two horrible mistakes and I saw the correct continuation. What I thought was really interesting is how the computer reacted. In what I thought would lead to some sort of piece advantage after a king and rook fork turned out to be a mating situation. The only solution for the computer was to sacrifice the queen and trying to save her would have resulted in mates or even worse situations.
I will publish the PGN here, so you can explore the variations, but before that I want to point out another greatly interesting move. As the Black queen attempts to escape, the next move is a king-queen-rook fork, yet after the king moves White does not capture the queen but does a seemingly random move: 12. Qd4. Why is that? I leave you to check it out for yourselves!

1. e4 e5 2. Nf3 d5 {The Elephant Gambit} 3. Nxe5 Qf6 4.
d4 dxe4 5. Nc3 Bb4 6.
Bd2 Qf5 {A really bad move giving a 3 point advantage to
White.} 7. Nd5 Bd6 8. c3 {My turn for a bad move,
anything went there, Bc4, g4, but I did this, going back to 1 pawn
advantage.} Bxe5 9. dxe5 Qxe5 {Disastrous move, but interesting. Check out the continuations.} (9.
.. Qd7 {This would have been the only decent move.}) 10. Bf4 Qxf4 {Amazingly, the only move here is to sacrifice the
queen for either bishop or knight. Attempts to save the queen lead to
mate!} (10. .. Qf5 {queen attempts to escape.} 11. Nxc7+ {leads to mate in
1. no matter when the king goes.} Kf8 (11. .. Ke7 12. Qd6#) 12. Qd8#) (10.
.. Qe6 {queen attempts to live just a bit longer.} 11. Nxc7+ {Chessgasm!
and Black's pain is only beginning.} Ke7 12. Qd4 {This is the most
interesting move here and by far the best by Houdini's calculations.} Nf6
(12. .. Nc6 13. Qc5+ Kd8 14. O-O-O+ Nd4 15. Rxd4+ Bd7 16. Qf8+ Qe8 17.
Qxe8#) (12. .. Qc6 13. Bb5 Qf6 14. Qb4+ Kd8 15. Qf8#) (12. .. Qf6 13. Qc5+
Kd7 14. O-O-O+ Qd4 15. Rxd4#) 13. Qc5+ Kd8 14. Nxe6+ Bxe6 15. Qc7+ Ke8 16.
Qxb7 Bd5 17. Qc8+ Ke7 18. Qxh8) 11. Nxf4 Nc6 {White wins
easily from +11 points} 1-0

and has 0 comments
White to move. Can you draw? Can you win? What would you do? Try - I know it's fucking hard, but do it anyway - to think it through.
[FEN "5kB1/3p1P2/7K/2Pp1P1P/p6p/4P3/7P/8 w - - 0 1"]
1. Kg6 a3 2. h6 a2 3. h7 a1=Q 4. h8=Q Qxh8 (4. .. Qg1+ 5. Kh5 Qxe3 (5. ..
Qg7 6. Qxg7+ Kxg7 7. Kxh4 d4 8. f6+ Kf8 9. c6) 6. Qf6 Qf3+ 7. Kh6 Qf4+ 8.
Kh7) 5. f6 h3 6. Kg5 d4 7. c6 dxc6 8. exd4 c5 (8. .. Qxg8+ 9. fxg8=Q+ Kxg8
10. Kg6 Kf8 11. f7 Ke7 12. Kg7) (8. .. Qh7 9. Bxh7 Kxf7 10. Bg8+ Kxg8 11.
Kg6 Kf8) 9. d5 c4 10. d6 c3 11. d7 c2 12. d8=Q# 1-0


Here is the video for it, from very good channel ChessNetwork:


Enjoy!

and has 0 comments
I will give you this as a puzzle, so please try to figure out that White's move is going to be. This and a lot of cool other puzzles are presented by IM Andrew Martin in the following video.

[Event "Ch URS"]
[Site "Moscow"]
[Date "1956.??.??"]
[Result "1-0"]
[White "Tigran Vartanovich Petrosian"]
[Black "Vladimir Simagin"]
[ECO "A53"]
[PlyCount "95"]

1. Nf3 Nf6 2. c4 c6 3. Nc3 d6 4. d4 g6 5. e4 Bg7 6. Be2 O-O
7. O-O Bg4 8. Be3 Nbd7 9. Nd2 Bxe2 10. Qxe2 e5 11. d5 c5
12. Rab1 Ne8 13. f3 f5 14. b4 cxb4 15. Rxb4 b6 16. a4 Bf6
17. Kh1 Bg5 18. Bg1 Nc7 19. Rbb1 Na6 20. Nb3 Ndc5 21. Nxc5
bxc5 22. exf5 gxf5 23. g4 fxg4 24. Ne4 Bf4 25. Rb7 Nc7
26. fxg4 Ne8 27. g5 Qc8 28. Re7 Qh3 29. Rf3 Qg4 30. Qd3 Bxh2
31. Rxf8+ Kxf8 32. Rxe8+ Rxe8 33. Bxh2 Re7 34. Nxd6 Qxg5
35. Qf1+ Kg8 36. Ne4 Qh4 37. Qe2 Rg7 38. d6 Qh6 39. Qd1 Qh4
40. Qe2 Qh6 41. Qf1 Rf7 42. Qg2+ Kf8 43. Ng5 Qxd6 44. Qa8+ Kg7
45. Bxe5+ Qxe5 46. Qh8+ Kxh8 47. Nxf7+ Kg7 48. Nxe5 1-0


Did you find it? I have to admit I did not. The game is Tigran Vartanovich Petrosian vs Vladimir Simagin, played in 1956.

[well, no following video, because YouTube just randomly removes content without any way of knowing what it was]

and has 1 comment

I've been monitoring more closely the access to my blog and I noticed that a lot of people are interested in the post about the Sicilian Wing Gambit, defined as pushing b4 in reply to the standard Sicilian Defense e4 c5. So I will be trying in this to use new knowledge and computer engines to revisit this funky opening gambit. As such I will be using LiveBook, a system created by the people at ChessBase that tries to catalog and discover chess based on active chess games and analysis, as well as computer engines, in this case Komodo 9 with a 256MB table memory. I've continued each variation until there was only 1 game left in the database, then I stopped.

Main line from LiveBook


Let's start with LiveBook. Here is a PGN with the main variations in order of use. You will notice that the main line is to accept the gambit (GM Jan Gustafsson even wrote "take the pawn and be happy!" at that particular junction), then refuse the second pawn and immediately challenge the center - which would have been the Sicilian idea all along - by pushing d5. It loks a bit like a Scandinavian Defense, but without White being able to push the Black queen back with Nc3. The main line shows Black gaining advantage, but then losing it by move 12, where equality sets in. However, the computer does not recognize some of the moves in the main line as best.

In the line that I was interested in, the one where Black takes the pawn on the a-file, White gains the classical center and technically it is ahead in deployment of minor pieces, if one considers a knight on the a-file and a semi blocked in bishop developed pieces. However, not all is lost, as the computer has some ideas of its own. Also keep in mind that the Sicilian Wing Gambit is not well known and few people actively employ it.

So here is the PGN of the LiveBook database, based on what people played: 1. e4 c5 2. b4 {This is the Sicilian Wing Gambit. From here on, the percentages in the comments are wins for White and the points are from computer engines.} cxb4 (2... b6 3. bxc5 bxc5 4. Nc3 Nc6 5. Rb1 g6 6. g3 Bg7 7. Bg2 Ba6 8. Nge2 {50% / 0.00}) 3. a3 d5 (3... bxa3 4. Nxa3 d6 5. d4 Nf6 6. Bd3 Nc6 7. c3 e5 8. Ne2 {50% / -0.33}) (3... e6 4. axb4 Bxb4 5. Bb2 (5. c3 Be7 6. d4 d6 7. Bd3 Nf6 8. Ne2 Nc6 9. O-O O-O) 5... Nf6 6. e5 Nd5 7. c4 Ne7 8. Na3 (8. Qg4 Ng6 9. h4 h5 10. Qg3 Nc6 11. Bd3 {50% / -0.75}) 8... Nbc6 9. Nc2 Ba5 {50% / -0.25}) 4. exd5 Qxd5 5. Nf3 (5. Bb2 e5 6. Nf3 Nc6 7. c4 Qe6 8. Bd3 Nf6 9. O-O
Bd6 10. Re1 O-O 11. axb4 Nxb4 12. Bf1 {75% / 0.00}) 5... e5 6. Bb2 (6. axb4 Bxb4 7. c3 Be7 8. Na3 Nc6 9. Nb5 Qd8 10. d4 exd4 11. Bf4 Kf8 12. Nbxd4 Nxd4 13. Nxd4 {50% / 0.00}) (6. c4 Qe6 7. Bd3 Nc6 8. Bb2 Nf6 9. O-O Bd6 10. Re1 O-O 11. axb4 Nxb4 12. Bf1 {75%}) 6... Nc6 7. c4 Qe6 8. Bd3 Nf6 9. O-O Bd6 10. Re1 O-O 11. axb4 Nxb4 12. Bf1 e4 13. d3 Qd7 14. dxe4 Bc5 15. Bxf6 Qxd1 16. Rxd1 gxf6 {50% / 0.00} *


Computer analysis: main line


Now let's put Komodo on the job, let us know what is going on here. Many people analysed the position resulting after pushing b4 and with depths of 36 and 40, computer engines overwhelmingly suggest taking the pawn. However we might want to explore what happens if we take another option. It is interesting to note that Komodo 9 pushes the main move as the third most important at depth 24. Perhaps later on this would get reversed again, but this soon into the game it just tells us that the other options are equally good. The two moves I am talking about is d5 and e5. Interestingly enough, the second most common human move (b6) is not even on the radar for the computer, while the computer move appears to have been played only 4 times by humans. So let's take a look at computer moves:1. e4 c5 2. b4 d5 3. exd5 cxb4 4. a3 Qxd5 5. Nf3 e5 6. axb4 Bxb4 7. c3 e4 8. cxb4 exf3 9. Qxf3 Qxf3 10. gxf3 * At the end of all this, White has four pawn islands and doubled pawns, but can quickly use the semi open files to attack with rooks. Maybe this discourages you, but remember two things: these are computers making these moves and while the position looks weird, you get attacking chances with no loss of material. That is the purpose of a gambit after all.

Computer analysis: accepting both pawns


Let's see what computers say about the line that we want to happen. The gambit is accepted, the a-pawn is captured as well. What then? I was surprised to see that, depending on depth and engine, the next move is quite different. Stockfish 6, at depth 39 goes with d4, taking control of the center and ignoring the Black a-pawn. The variations from this position are quite complex and have less to do with this gambit. I would gamble (pardon the pun) that the purpose of the wing gambit was reached at this point. Computers give a clear equality between players, but remember that even after we capture the a-pawn, we have still would be a pawn down. Black is forced to passive moves like e6, d6, having to spend resources to regain center control, while most White pieces have clear attack lines.

An example: 1. e4 c5 2. b4 cxb4 3. a3 bxa3 4. d4 e6 5. Nf3 d5 6. e5 Bd7 7. Bd3 Nc6 8. Nxa3 Bb4+ 9. Bd2 Bxd2+ 10. Qxd2 a6 *

Computer analysis: accepting just the first pawn


But what happens in between these two options? What if Black accepts the gambit, but doesn't take the second pawn? Will the computer see the same result as in the "human main line" we first discussed? Not quite. The computer moves are really different from the human ones. 1. e4 c5 2. b4 cxb4 3. a3 e5 4. Nf3 Nc6 5. Bb2 Nf6 6. Nxe5 Qe7 7. Nf3 Nxe4 8. Be2 d5 9. O-O Qd8 10. Bb5 bxa3 11. Nxa3 Bc5 * The result is another equal position, where White lost the center, but has a strong, yet weird development.

Also check out 3... d5: 1. e4 c5 2. b4 cxb4 3. a3 d5 4. exd5 Qxd5 5. Nf3 e5 6. axb4 Bxb4 7. c3 e4 8. cxb4 exf3 9. Qxf3 Qxf3 10. gxf3 Ne7 * An interesting tactic is not to take the d5 pawn and instead advance the e-pawn to e5: 1. e4 c5 2. b4 cxb4 3. a3 d5 4. e5 Nc6 5. Bb2 Qb6 6. Nf3 Bg4 7. axb4 Qxb4 8. Bc3 Qe4+ 9. Be2 Bxf3 10. gxf3 Qf4 11. d4 * You can watch an example game in this variation from Kingscrusher.
My opinion on this is that White forces a strong center, but, as seen from the computer variation, the sides get seriously compromised. The truth is that I always wondered if there is a solid play with the king in the center. This might be it, although keep in mind that in that position White is a pawn down.

What if we start with b4 and then try to move towards the center?


Well, that's easy to answer: it's another opening :) called the Polish or Sokolsky opening and I have written another blog post about it, although it is pretty old. Maybe I will also revisit that one. The point with that opening is that it already shows Black what we plan and it has some other principles of work, more closely related to the English opening to which it sometimes transposes. The Wing Gambit, though, is a response to the Sicilian, trying to pull the opponent from their comfort zone and into ours.

What if we delay the b4 push?


One can wait for the wing gambit until knights have left their castle. That's called the Portsmouth Gambit (1. e4 c5 2. Nf3 Nc6 3. b4) and some consider it stronger than the gambit presented here. It might be interesting to analyse. Haven't found a lot of resources on it, just this 2014 book from David Robert Lonsdale.

Another option is to play 3. a3, preparing a support of b4 on the next move. It does produce similar results as the base gambit, but I didn't have time to analyse it and it feels a bit slow, to be honest.

When Black defends with b6


Defending c5 with b6 leads to a Sicilian without the b-pawns. That means that an attack on the queen side is out and the White light square bishop can linger around on the queen side as long as it wants, targeting that juicy Black king side from afar. Combine that with the dark square bishop having a nice diagonal as well. 1. e4 c5 2. b4 b6 3. bxc5 bxc5 4. Nf3 Nc6 5. Bb5 Nd4 6. Nxd4 cxd4 *
For an example of that variation, check out Kingscrusher's video.

Traps in the Sicilian Wing Gambit


I couldn't find a lot of traps in the Sicilian Wing Gambit. One good video on this comes from GJ_Chess (ignore his Indian accent, he is actually quite good and, what I like a lot, he focuses on traps and dirty tricks in his videos):

[youtube:5KNVTce4tmE]

Other ideas and nomenclatures


The ECO category for this opening is B20, same as for the Sicilian Defense, which doesn't help a lot.

After Black captures the b-pawn, c4 is called the Santasiere variation of the Wing Gambit, and Black's only option seems to try for control of d4 with either e5 or Nc6. Taking en-passant is giving White a lot of compensation in development.

The goading of the Black pawn with a3 that we've covered above is called the Marshall variation. If Black pushes the pawn to d5 and White captures, we enter the Marienbad variation, while if Black captures the a-pawn, it is called Carlsbad variation. For the record, bad is the German name for bath not an indication that the variation is bad :).

Pushing a3 before b4 is called the Mengarini gambit. Check out a game from 2013 between Dobrov and Blom.

Other resources on the gambit


A nice review of this gambit, with names of the variations and some human analysis, can be found on chess.com. (The same author has a post on The Portsmouth Gambit as well)

On chesstempo there is a nice list of games with this variation that you can search. Play around with the Advanced Search parameters. As a reference, there are 11 games from people over 2500 using the Wing Gambit and White has most wins. If restricting to games after 2000, you only get one, which ended in a draw, although White was better at the end. You can see the game here: Timur Gareev vs Gata Kamsky, US Championship (2015).

Interesting Wing Gambit/Fried Liver attack combo that you can see here: John P. Pratt vs Elden Watson, 29 Sep 1976, Hill Air Force Base, Utah. You gotta love that. Not the best rated players in the world, but still. Here is a lichess computer analysis of the same game.

A 2013 call to reevaluate the Wing Gambit with some examples of famous old games where the opening had a strong effect.

Conclusions


Unlike the Sokolsky opening, the purpose of the Sicilian Wing Gambit is not to push the b-pawn to block Black's development, but to deflect the c-pawn from protecting the center. The goal is reached when White has a strong center. In no way does it mean it is a winning gambit. There are no brutal traps, no quick wins, the only purpose of this opening is to pull an aggressive Sicilian player from their comfort zone and into a slower, more positional one. That means that the White player needs to attack like crazy until Black is a mere smear on the board, otherwise the center control and speed advantage that may be obtained from the opening can be easily lost.

From my analysis I gather that Black should accept the gambit, but not continue to take pawns like the a-pawn, instead focusing on their own piece development and control of the center. With perfect computer play, equality is reached and maintained. White often fianchettoes the dark square bishop to b2 from where they put pressure on the Black king side. Black's game often centers on exchanging pieces, so that the opening advantage gets lost. The best chance Black has to decline the gambit seems to be pushing d5, going into murky territory.

White on the other hand should push for the center, even propping the d-pawn with c3 and blunting the dark square bishop diagonal. Then focusing on attack is the most important feature, as in most gambits.

Careful with the variation in which Black attacks the e4 pawn with d5, then capturing with the queen after the exchange. If not careful the queen can fork the king and the rook. That is why Nf6 is played by White as the next move or even Bb2, although that's not as good, as the bishop can be deflected.

Usually the a-pawn is recaptured with the knight, not the bishop. This may seem surprising, but what it prepares is moving the knight on b5, attacking c7 and a7 and being very hard to dislodge, as the a-pawn is pinned to the rook. Some variations sacrifice the Black rook in the corner for a quick counter-attack. In case it is captured with the bishop, the idea is to exchange dark square bishops and prevent the Black king from castling.

In several games I have seen, moving towards the center forces Black to use e6 followed by d5, to which White can respond with e5 themselves and get into French defense territory. Personally I dislike playing against the French, but in this case, without b-pawns, the theory is quite different as well. For an example, check out this video from Kingscrusher.

Even if caustic GM Roman Dzindzichashvili categorized this as the worst opening for White, don't forget that it was used by Fischer in 1992 to beat Spassky. Well, a transposition thereof. If you are confident in your chess skills, this is just as good an opening as any other and at least you need to know it a little in order to defend against it.

I would love some comments from some real chess players, as all of this is based on game databases and computer analysis. Please leave comments with what you think.

Video examples


Here is Simon Williams using the gambit against a young Polish player:


[youtube:NkD12gJcbO4]

ChessTrainer shows a nice game where he uses the gambit to get a quick center and take his opponent out of Sicilian main lines:

[youtube:KITg5dYVsYk]

MatoJelic is showing us some classical games:
Thomas A vs Schmid, Hastings 1952

[youtube:8UTSqKIPQ-8]


Wood L vs Mease A ,USA, 1949

[youtube:XkymLpg781c]

and has 0 comments
There is a nice web site called Chess Pastebin that allows one to publish a chess game as a PGN, comment on it using a Disqus form and share it with whomever you wish. However when I tried to use it, it refused to accept my PGN (extracted from Chess Arena). After many trials I realized that it considered invalid a move written as 10. .. some move instead accepting only 10... some move (no spaces between the dot of the move number and the dots representing a black move after a variation). So just replace ". .." with "..." to get a PGN acceptable by Chess Pastebin.

and has 1 comment
I was watching a video from GM Niclas Huschenbeth where he played lytura in an online game. Amazingly he lost, but that is what happens when you underestimate your opponent, which I think was what actually went wrong. At the end of the video it was difficult to see exactly what White could have done after a point, so I analysed the game with the computer and found some amazing moves. First I will show you the original game. I urge you to think it through and see what moves you would have done differently, like a chess puzzle, before you watch the game as the computer suggested it. You can also watch the video online at the end of the post and, if you like chess, I really recommend Huschenbeth's channel. Not only is he a great player, but also a decent and nice guy and young, too. His Blitz & Talk GM Special videos are especially cool, since he plays with other world class grand masters.

But enough of that. Here is the game, up to a point where it didn't really matter what happened: 1. e4 e5 2. f4 exf4 3. Nf3 g5 4. Nc3 g4 5. Ne5 Qh4+ 6. g3 fxg3 7. Qxg4 g2+ 8. Qxh4 gxh1=Q 9. Qh5 Nh6 10. d3 d6 11. Bxh6 Be6 12. Bxf8 Rxf8 13. Nf3 Nd7 14. O-O-O c6 15. Bh3 Nf6 16. Rxh1 Nxh5 17. Bf1 Rg8 18. Ne2 Kd7 19. Kd2 Rg7 20. Ke3 Rag8 21. a3 Nf6 22. h3 b6 23. d4 a5 24. Nf4 Rg3 25. Ne2

Here is the video of the game, to give you the time to think it through:


And finally, here are two lines that the computer recommended. This is considering that the fateful 10. d3 was played already: 1. e4 e5 2. f4 exf4 3. Nf3 g5 4. Nc3 g4 5. Ne5 Qh4+ 6. g3 fxg3 7. Qxg4 g2+ 8. Qxh4 gxh1=Q 9. Qh5 Nh6 10. d3 d6 11. Bxh6 Be6 12. Bxf8 Rxf8 13. Nf3 Nd7 14. O-O-O c6 15. Nb5 Nf6 (15. .. cxb5 16. Bh3 Qxd1+ 17. Kxd1 O-O-O 18. Bxe6 fxe6 19. Nd4 {White +1.2}) 16. Nxd6+ Kd7 17. Qh3 Bxh3 18. Bxh3+ Kxd6 19. Rxh1 {Black +0.3}

Did you see those Nb5 and Qh3 moves?! Who does that? :)

and has 0 comments

Some time ago I started playing chess, got a trainer, played with my colleagues and friends. I felt a passion for the game that I have no idea from where it came and, just as suddenly as it appeared, it vanished. For more than a year I have not even looked at chess videos. I can't say when I would start playing again, not even if I ever would. And it's not because I am not really good at the game :), it is just a matter of random passion.

Passion is probably what made the creators of Lichess create the server. It is a chess site with a very clean interface, a lot of options, even a REST API (that's a programming thing, don't worry about it). Most of all, the site is completely free, no ads, no nags and a mission statement that ensures that the game will remain thus forever. Open source, with a lot of help from the community, Lichess shows a passion for both software development and chess. If I will ever start playing again, it will probably be because of people like these. Thanks, guys!

MinMax or Minimax, as some like to call it, is the basis of most Artificial Intelligence built for games like chess. Its basis is extremely easy to understand: a rational player will try to take the best option available to them, so whatever is good for me the adversary will take as the most likely outcome and he will find the best solution against that outcome. I, following the same pattern, will also look for his best counter move and plan against it. Therefore the thinking for a game of chess, let's say, is that I will take all possible moves, find the one that leaves me with the best position (evaluated by a function from the board position), then look for the similar best play for the adversary. I continue this way until I get to the end of the game or am out of computing resources.

Now, that sounds logical and it's crazy easy to implement. The problem is that for all but the most childish of plays, the tree of all possible moves increases exponentially. And chess isn't even one of the worst games to do that. Imagine Tic-Tac-Toe, a game played on a 3x3 board between two players. You have a total of 9 possible moves to choose from as the first player, then 8, then 7, etc. The entire game tree has a total of 9! possible moves, or 362880. But generalize the game to a board of 10x10 and a winning rule of 5 in a line and you get 100! moves, which is less than 1E+158, that is 10 followed by 158 zeros.

That's why the so called pruning was created, the most common of all being Alpha-Beta, which tries to abort the processing of leaves that seem to reach a worse situation than their parent node. Of course, all of this is the general gist. You might want to take into account a number N best moves from the opponent, as well as try a more lenient pruning algorithm (after all, sacrificing a piece brings you to a worse position than when you started, but it might win the game). All of this increases, not decreases the number of possible moves.

And now comes my thought on this whole thing: how can I make a computer play like a human when the core edict of the algorithm is that all participating players are rational? Humans are rarely so. Mathematically I could take N, the number of best moves I would consider for my opponent, to be the total number of moves my opponent could make, but it would increase the exponential base of the tree of moves. Basically it would make the algorithm think of stupid things all the time.

The pruning algorithm seems to be the most important part of the equation. Indeed, I could consider the move choice algorithm to be completely random and as long as I have a perfect pruning algorithm it will remove all the stupid choices from me and let me with the smart ones. A quote comes to mind: "you reach perfection not when you have nothing else to add, but when there is nothing left to remove". It's appropriate for this situation.

Now, before attacking an algorithm that has survived for so long in the AI industry (and making my own awesome one that will defeat all chess engines in the world - of course, that's realistic) I have to consider the alternative algorithm: the lowly human. How does a human player think in a game of chess? First he surveys the board for any easy wins. That means a broad one or two levels analysis based on a simple board evaluation function. Immediately we get something from this: there might be multiple evaluation functions, we don't need just one. The simple one is for looking for greedy wins, like "He moved his queen where I can capture it, yay!".

The same outcome for situations like this would be achieved by a MinMax algorithm, so we ignore this situation. It gets more interesting from now, though. We look for the moves of the most active pieces. I know that this is the rookie system, but I am a rookie, I will make my computer algorithm be as stupid as I am, if I am to play it, so shut up! The rookie will always try to move his queen to attack something. It's the most powerful piece and it should get the most results for the least effort. We left Greed behind, remember? We are now doing Sloth. Still, with a good pruning algorithm we eliminate stupid Queen moves from the beginning, so considering the Queen first, then Rooks, then Bishops, then Knights, etc. is not a bad idea. The order of the pieces can be changed based on personal preferences as well as well established chess rules, like Knights being better that Bishops in closed games and so on.

This is a small optimization, one that probably most game engines have. And we haven't even touched pruning; boy, this is going to be a long article! Now, what does the human do? He does the depth first tree searches. Well, he doesn't think of them like that, he thinks of them as narrative, but it's basically a depth first search. This is the casual "What if...?" type of play. You move the Queen, let's say, bringing it right in the enemy territory. You don't capture anything important, but to bring a strong piece this uncomfortably near to the enemy king is scary. You don't play for game points, but for emotion points, for special effects, for kicks! You don't abandon the narrative, the linear evolution of your attack, until you find that it bears no fruit. It's the equivalent of the hero running toward the enemy firing his pistol. If the enemy is dumb enough to not take cover, aim carefully and shoot a burst from their SMGs, you might get away with it and it would be glorious. If not, you die idiotically.

It is important to note that in the "Hollywood" chess thinking you are prone to assume that the enemy will make mistakes in order to facilitate your brilliant plan. The evaluation goes as follows: "I will try something that looks cool if the chances for a horrible and immediate loss are small". When some hurdle foils your heroic plan, you make subplans that would, as well as you hope, distract the adversary from your actual target. This, as far as I know, is a typical human reasoning type and I doubt many (if any) computer game engines have it. In computer terms, one would have to define a completely new game, a smaller one, and direct an AI designed specifically for it to tell you if it would work or not. Given the massively parallel architecture of the human brain, it is not hard to understand why we do something like this. But we can do the same with a computer, mind you. I am thinking of something like a customized MinMax algorithm working on few levels, one or two, as the human would. That would result in a choice of N possible moves to make. Then construct a narrative for each, a depth search that just tries to get as much as possible from each move without considering many of the implications. Then assign a risk to each level of this story. If the level exceeds a threshold, use the small range MinMax at those points and try to see if you can minimize the risk or if at that point the risk makes your narrative unlikely.


Let's recap the human thinking algorithm so far:
  1. Try to greedily take what the opponent has stupidly made available
  2. Try to lazily use the strongest piece to get the most result with the least effort
  3. Try to pridefully find the most showy move, the one that would make the best drinking story afterwards
  4. Try to delegate the solving of individual problems in your heroic narrative to a different routine

Wow! Doesn't it seem that the seven deadly sins are built-in features, rather than bugs? How come we enjoy playing with opponents that pretty much go through each of them in order to win more than we do with a rational emotionless algorithm that only does what is right?

Again, something relevant transpires: we take quite a long time imagining the best moves we can make, but we think less of the opponent's replies. In computer terms we would prune a lot more the enemy possible moves than we would our own. In most rookie cases, one gets absorbed by their own attack and ignores moves that could counterattack. It's not intuitive to think that while you are punching somebody, they would choose to punch back rather than avoid the pain. In chess it's a little bit easier and more effective, since you can abandon a piece in order to achieve an overall gain in the game, but it can and it is done in physical combat as well.

Okay, we now have two alternatives. One is the logical one: take into account all the rules chess masters have taught us, shortcuts for achieving a better position on the board; choose moves based on those principles and then gauge the likely response from the opponent. Repeat. This is exactly like a MinMax algorithm! So we won't do that. The hell with it! If I can't enjoy the game, neither will my enemy!!

Human solution: don't do anything. Think of what your opponent would do, if you wouldn't move anything and foil their immediate plan. This way of thinking would be counterintuitive for a computer algorithm. Functioning on the basis of specific game rules, a computer would never be inclined to think "what would the enemy do if I didn't move anything, which is ILLEGAL in chess?". That makes us superior, obviously ;-)

Slowly, but surely, a third component of the algorithm becomes apparent: the move order choice. Let's imagine a naive MinMax implementation. In order to assess every possible move, it would have to enumerate them. If the list of moves is always the same in a certain board position, the game will always proceed the same way. The solution is to take the list of possible moves, but in a random order. In the case of the "human algorithm" the ordering becomes more complex (favouring powerful piece moves, for example). One could even consider the ordering mechanism responsible for choosing whether to do a careful breadth search for each level or a depth first one.


Here is a suggestion for an algorithm, one that takes into account the story of the game and less the objective gain or position strength:
  1. For each of your power pieces - anything but the king and pawns - compute mobility, or the possibility to move and attack. Favour the stronger pieces first.
  2. For each power piece with low mobility consider pawn moves that would maximize that mobility.
  3. For each power piece with high mobility consider the moves that would increase the chance of attack or that would attack directly
  4. For each strong move, consider the obstacles - enemy pieces, own pieces, possible enemy countermeasures
  5. Make the move that enables the considered power move or that foils the enemy attempts of reply

The advantage of this approach is that it only takes into account the enemy when he can do something to stop you, the pawns only when they can enable your devious plan and focuses on ventures that yield the best attack for your heroes. For any obstruction, you delegate the resolution of the problem to a different routine. This makes the algorithm parallelizable as well as modular - something we devs love because we can test the individual parts separately.

This algorithm would still use a board estimation function, but being more focused on heroic attacks, it would prefer interesting move orders to static positions as well as the "fun factor", something that is essential to a human-like algorithm. If the end result of the attack is a check-mate, then it doesn't really matter what position estimate you get when you did half the moves. All one has to wonder is if the attack is going to be successful or not and if one can do something to improve the chances of success. And indeed this is one of the most difficult aspects for a chess playing human: to switch from a failing plan to a successful plan when it is not yet clear is the first plan is failing. We invest energy and thought into an idea and we want it to work. A lot of the chess playing strategy of human rookies relies on prayer, after all. A computer would just assess the situation anew at every move, even if it has a strategy cached somewhere. If the situation demands it, a new strategy will be created and the last one abandoned. It's like killing your child and making another!


But, you will say, all you did so far was to describe an inferior algorithm that can be approximated by MinMax with only custom choices for the pruning and move order functions! You are missing the point. What I am describing is not supposed to beat Grand Masters, but to play a fun game with you, the casual player. More than that, my point is that for different desired results, different algorithms must be employed. This would be akin to creating a different AI for each level of a chess game.

Then there is the issue of the generalized TicTacToe or other games, such as Arimaa, created specially to make it difficult for computer algorithms to play, where MinMax fails completely. To make a comparison to real life, it's like you would consider the career steps you would take in life based on all possible jobs available, imagining what would it be to be employed there, what the difficulties might be, finding solutions to those problems, repeating the procedure. You will get to the conclusion that it is a good idea to become a computer scientist after thoroughly examining and partially understanding what it would be like to be a garbage man, a quantum scientist, a politician and a gigolo, as well as all the jobs in between. Of course, that is not as far fetched as you think, since in order to be a success in software development you must be at least a politician and a garbage man, perhaps even a gigolo. Lucky for our profession, quantum computers are in the works, too.

The same incongruency can be found when thinking of other games humans enjoy, like races. The desired result can only be achieved at the end of the race, when you actually get somewhere. In order to get to that specific point in space, you could consider the individual value of each direction change, or even of each step. However humans do it differently, they specify waypoints that must be achieved in order to get to the finish and then focus on getting from waypoint to waypoint, rather than rethinking the entire course. In computer terms this is a divide-and-conquer strategem, where one tries to solve a problem that has known start and end points by introducing a middle point and then solving the problem from the start to the middle. BTW, this also solves Zeno's paradox: "Why does the arrow reach its target if, at any point in its course, it has at least half the distance left to fly?" and the answer is "Because of the exit condition that prevents a stack overflow". Try to sell that one in a philosophy class, heh heh.


So why aren't chess AIs based on human thinking processes? Why don't they implement a divide and conquer solution for a game that always starts with a specific board position and ends in capturing a specific piece? Why do chess engines lower their "level" by sometimes randomly choosing a completely losing path instead of something that is plausible to choose, even if completely wrong objectively? How can MinMax be the best general algorithm for game AIs, when some of them have a branching factor that makes the use of the algorithm almost useless?

I obviously don't have the answers to these questions, but I may have an opportunity to explore them. Hopefully I will be less lazy than I usually am and invent something completely unscientific, but totally fun! Wish me luck!

and has 0 comments
I've had some changes in my life lately and more are coming so I took a break from chess, but I found a bit of time to finish this chess puzzle book that I started reading a few months ago, but never quite got around to complete. Chess Tactics for Champions is not really for champions, but for beginner to intermediate level, or at least this is what it felt like to me. Susan Polgar chose to structure the book into chapters of about 25 puzzles or examples, each covering some important aspect of chess tactics. Here is a list of those chapters:
  • 01 - Forks and double attacks
  • 02 - Pins
  • 03 - Deflection/removing the guard
  • 04 - Discoveries
  • 05 - Double check
  • 06 - Skewers
  • 07 - Trapping pieces
  • 08 - Decoys
  • 09 - Intermediate moves
  • 10 - Pawn promotion
  • 11 - The back-rank problem
  • 12 - Destroying the castled king's protection
  • 13 - King chase
  • 14 - Mixed checkmates in two moves
  • 15 - Mixed checkmates in three moves
  • 16 - Mixed checkmates in four moves
  • 17 - Game-saving combinations
  • 18 - Perpetual check
  • 19 - Stalemate
  • 20 - Traps and counter traps
  • 21 - Sibling positions
  • 22 - Twenty-five famous combinations

The last two chapters are presentational only, but the first 20 contain puzzles that the reader must solve, with solutions at the end of the chapter. The authors tried to order the chapters by complexity, so that beginners could understand and solve the first chapters and then move over to the more advanced positions, but it is not always so. It seemed to me that, for most of the chapters, the last two puzzles are especially chosen for the "wow!" factor.

The bottom line is that the book is not just something you read. You solve the puzzles, some are frustrating, some are beautiful, most can be "seen" without a board in front of you - for the last chapter I would advise a board, though - but one can return to this book again and again. For example myself, once I get around to chess again, I might go through the book, just to get into the solving mindset that is essential to beautiful play. Now, I don't know how other chess puzzle books are, this being my second chess book I have read, but I imagine some could be a lot better. However, the structure of Chess Tactics for Champions makes it very easy to use as a reference book. One thing I felt was missing was pawn play. Of course, that often enters the category of strategic play, rather than tactic, but still.

More about the authors at Wikipedia: Susan Polgar and Paul Truong. They have been married since 2006.

and has 3 comments
As I mentioned in previous posts, I've started a chess learning program with a professional, so I can increase my understanding of the game. I was tired of watching Dennis Monokroussos' videos and understanding little of them. Why was he able to breeze through openings and only start explaining from move 20 or so? Why are the chess masters that I watch on videos able to say "this cannot be taken because of..." followed by a four move scheme that makes obvious the mistake, but that I couldn't see it?

And so I got this Romanian dude, Catalin Carmaciu, as an instructor. He may be a bit off putting at first, as it seems he is willing to teach you for free and show you everything he knows, give you any material you ask for and even take time to analyse your games, with any sort of payment as your choice. So, if you don't like open generous guys who are also very smart, I don't recommend him. Otherwise, he is great! His chess site is in Romanian. Anyway, he looked at the deplorable state of my chess understanding and said "What do you want to do? Win games or learn to be better?" I said I wanted both, of course, as any decent Neo who would swallow both pills. Of course, it is not easy. You might want to ask about the difference between the two. Isn't it obvious that if you play the game better you will also win more games? What kind of choice is that? And the answer is that for winning games you acquire a repertoire of openings and defences which you learn and exercise repeatedly, while for playing better you read and exercise tactics and strategy books.

My first reaction was disappointment. Here there was this brilliant chess player telling me I had to mechanically learn a series of openings, while I wanted to understand the concept of chess as a whole. But I was wrong to feel that way. You see, since then we've decided on four openings: two defences for standard White openings (e4 and d4) and two replies to defences by Black to my opening with e4 (e5 and c5). While at first it seems you learn some moves in a mechanical way and your only advantage is previous knowledge of a situation that you set up, the reality of it is that you choose the setup and for each you have a long term plan! In the middle game and end game you have a clear vision of what you want, where the attack goes, where to hinder the enemy's movements and what are the triggers for each. It would have been easy to say "for any possible game, you must make a strategic plan before you play", but unless you know what you are doing, that plan would suck. So, while playing these apparently memorized openings, I've developed a practice and an understanding of strategic planning in chess. I have also found answers to other, less common, openings. For example White might move Nf3, but that prohibits me playing e5, so I go with the d5 plan which was originally designed to stop White's d4. And behold, White then plays d4, transposing into a standard d4 opening.

Wait a minute, you jump, but you said the other "learning branch" was the one where you learned tactics and strategy! It is true: strategic thinking is exercised in both situations, only the first is somehow more adult: you learn by doing. Oh, I do have some tactics books that I am looking through and some general strategy books that are supposed to be awesome, but until I find the time and disposition to focus on them and read carefully and understand what is written there, I have the option of playing chess and learning as I go.

Another thing about getting a chess instructor is that he isn't doing much. There is no magical method that he can wield that improves your chess. Instead he instructs you on what is good to do and you must do it. The effort is yours. The bonus comes from his filtering the chess materials so you get the ones that actually help you. The rest is up to you. After a week of playing, he may look at your chess games and quickly tell you where you went wrong, but they have to be your games.

One thing that my instructor is adamant about is not to use chess engines to analyse your games. That's right! He is telling a computer programmer to not use computer programs for chess. I know, a bit off putting, but he finally convinced me completely when he said that after a (simulated) rating of 2000 ELO, the computers don't move anything like a human. As a 2500 player himself, he cannot prepare for chess championships or games with other players by playing with a computer. His method of analysis is personal: take your game, think of what you thought when you made the moves, see what went wrong with your plans, see what better moves you could have done. It makes sense, after all, to not use computer programs to analyse your strategic plans, since they don't have any.

So, in order to summarize, my solution for learning to play better chess is to find the opening repertoire that you want to use for most chess games. You don't do that in order to trap the other into little known situations, as I did for a while, but in order to set up a game where you are aware of the strategic plans that you and your opponent are prone to use. In the end the order of the moves might be different, the situation may change one way or another, but as long as you follow the plan, you should be OK.

and has 0 comments
Yes, yet another chess blog post. Don't worry, soon there will be a ton of rants about the programming world, just wait a bit.

This puzzle is from Chess Tactics for Champions, by four times women chess champion Susan Polgar. Here is a review of the book, much better than I could do it. So, on to the puzzle:

White to move.


[SetUp "1"]
[FEN "1k1r4/pP2q3/8/Q5pP/5bP1/5P1K/P1R5/8 w - - 0 1"]
1. Rc8+ Rxc8 2. Qxa7+ Kxa7 3. bxc8=N+ *