Chess Programming - the ultimate Challenge in computer science[...] Engine iCE 4 + Medium Book
Windows 32 and 64 bit

Chess and Computers - Nerds only stuff ?

It's been a long road getting from there to here...

The Turk Computers are able to play chess. They are able to do that for quiet some time now but for long chess was a domain of the Humans. Computers were not perceived as being able to compete in such a complex game like chess with human masters.

Deep Blue The first real approach to automate chess was made in 1914 with a machine constructed by Torres y Quevedo that could play an endgame of king and rook against king. Later in 1950 Claude Shannon described ideas of creating complete chess programs but the available hardware was not fast enough to run a real engine.

In 1989 a serious attempt was made to challenge human master hood in chess. Deep Thought, a super computer from IBM challenged Garry Kasparov, the World Champion, but lost both games. The research folks at IBM did not give up and roughly 10 years later, in 1997 IBM's Deep Blue was the first computer to win a whole match against the current world champion.

With the defeat of Garry Kasparov against a chess computer the time of human dominance in chess seemed over. But it required a computer like Deep Blue, able to calculate at a speed of about 200 million chess positions per second, to beat the human champion. This underlines the remarkable strength of Kasyanov's play.

Musical Chess

And were are we now

Mate in 516

Today the game of Chess is influenced by computers and how they address the game as much as human masters influence it. Opening lines are verified with their help or endgame table bases are created that contain shortest lines to mate for all positions with 6 pieces or less.

But are computers stupid and is it just processing power that lets them find a good move? They rely on processing power but does that make them stupid. Intelligence should not be defined by the way an answer is found to a question. It doesn't matter whether neurons have to correct weights and were interconnected correctly in a human brain or whether a search algorithm running on some form of hardware has found the answer to a difficult problem. If the outcome looks intelligent than some form of intelligence must have produced it. Where should it come from otherwise? Certainly not from the chess skill of their programmers, most chess engines play much stronger than their creators.

And chess engine programming is far away from just implementing a brute force search algorithm. Such an engine might be able to solve Mate in X problems but will have no real chance against human masters or even medium strength computer engines when playing a whole game.

Mate in 516

Chess is much to complex for such an approach. In a typical position each player has about 30 moves or more to make and the opponent has 30 or moves or more to respond. A player trying to think 3 moves into the future (for every move I can make I consider all possible responses of my opponent and then all my responses to his responses and so on) would have to consider 306 = 729 Mio possible positions. An average home computer even on today's hardware would require a significant amount of time to calculate them and to think 3 moves into the future is even for an average human no problem.

When humans are asked how they play chess, they will probably state, they look for promising moves only and think about responses of their opponent and what their choices are after the opponent has played his best move. If they find a good move they keep looking to find an even better move. At the end computer engines do the same. They spend more time on promising moves than on moves that look stupid and they also make errors in their decision about what move might be stupid, just like humans. A strong engine will just make less error than a weak engine.

Victory goes to the player...

So what makes chess programming interesting enough to dedicate a part of its spare time to it? For someone interested in computers and computer science chess programming is great. It combines

  • aspects of game theory, which is not just fun at all, because economic behaviour of market participants can be described with game theory fundamentals. So game theory is taught at universities and plays an important role in the industry.
  • Essential algorithms and data structures of computer science like hash functions, sort algorithms, recursive functions or random number generation.
  • Computer science fundamentals like relying on binary logic to bitwise manipulate data structures.
  • Gaining programming experience in a chosen computer language especially with the goal to write very efficient but also very clean code
  • Strong competition and a community of fellow programmers. After all you want your engine be stronger than engines from other programmers, which can be very motivating.

So while developing a chess engine you gain a lot of experience that is very useful or interesting for someone that works in the IT industry.

That's why I'm into it.