This blog will discuss the game of chess. In particular, I will focus on the rules of chess and their sometimes strange consequences, computer chess, weird chess positions, and exploring the statistics that can be extracted from large chess databases, as well as the chess gems hidden therein.
A large inspiration for me is Tim Krabbé's Chess Curiosities site - I love his articles and I recommend them to any chess enthusiast. Mr. Krabbé is a much more able chess player than I am, but still I hope to bring to light some new things that he may have missed.
I am a software engineer by heart and by profession, and I wrote my first piece of chess software about 10 years ago. It started out as a humble move generator, i.e., a subroutine that enumerates all legal chess moves given a certain position. It was surprisingly hard to get this 100% right, and the process of tracking down bugs got me thinking about the chess rules, and the subtle ways you can go wrong while implementing them. Some of the lessons learned I will share with you on these pages.
On top of the move generator core I built some actual programs, such as a chess problem solver, and a program to count all possible games that can be played from a given position up to a certain depth. I also implemented a chess-playing program, but I never brought it to a level where it posed a serious challenge even for me. It would usually protect its queen against capture, and find mate-in-2 when the opportunity was there, but that was about it.
At some point I stopped playing around with computer chess and moved on to other things. But recently I had a bit of free time, so I decided to revive my little chess project.
I originally wrote my chess code in the programming language C, and although at the time I thought I was a pretty decent programmer, it turned out that there was quite a bit of room for improvement. Furthermore, I have since come to appreciate the limitations of C, so I decided to convert all of it to C++.
One of the things I originally did was to write a program to read databases of chess games given in Portable Game Notation (PGN). I re-implemented that program as well, and I set it loose on the well-known MegaDatabase that is published by German chess-software company ChessBase. This database contains over five million games of chess, most of which are games between very decent players. Analysing this large body of chess data yields some very surprising insights; more on that later.
So much for the introduction. I hope I piqued your interest, and I will present my first article with actual chess content later today.
Post a Comment