Sunday, 6 May 2012


As I have an interest in programming as well as chess it is not surprising that I've often considered the idea of writing a chess program. Well I've finally decided to have a go. Well it's not quite chess. I've decided to first try something simpler. As a practice run I am writing a program to play chess on a 6x6 board. I am writing this in Visual Basic 6 which would probably not be the best choice for a chess program, but with the speed of computers now and the reduced size of board. I'm hoping a strong program can still emerge. One should also bear in mind that VB6 is a compiled language unlike future versions such as VB.NET etc. Therefore, assuming I'm not doing any bit twiddling - which VB was not made for - I'm hoping it's array handling capabilities can kick ass. If the program is successful I plan to then progress to writing a full chess program, possibly for a Java Applet. Obviously I'll eventually make the programs freely available.

I call the program: 'Son of Maniac'. It is so called because it was inspired by a program written in 1956 by Kister, Stein, Ulam, Walden and Wells at the Los Alamos Scientific Laboratory in New Mexico. Their program played a miniature version of chess on a 6x6 board. There were no bishops, no castling and the pawns could only move one square on their first move. The program ran on a MANIAC computer with a speed of 11000 operations per second. This enabled the program to perform an exhaustive search to a depth of 4-ply in an average of 12 minutes.

The only recorded game (that I know of) played by the program was against a young lady member of the laboratory who was taught how to play chess a week earlier. The game went as follows:

Black: Human

1    d2-d3      b5-b4
2    Ne1-f3     d5-d4
3    b2-b3      e5-e4
4    Nf3-e1     a5-a4
5    b3xa4?     Nb6xa4
6    Kd1-d2?    Na4-c3
7    Nb1xc3     b4xc3+
8    Kd2-d1     f5-f4
9    a2-a3      Ra6-b6
10   a3-a4      Rb6-a6
11   a4-a5      ...

11   ...        Kd6-d5
12   Qc1-a3     Qc6-b5
13   Qa3-a2+    Kd5-e5
14   Ra1-b1?    Ra6xa5
15   Rb1xb5     Ra5xa2
16   Rb5-b1     Ra2-a5
17   f2-f3      Ra5-a4
18   f3xe4      c5-c4
19   Ne1-f3+    Ke5-d6
20   e4-e5+     Kd6-d5
21   e5xf6=Q    Ne6-c5
22   Qf6xd4+    Kd5-c6
23   Nf3-e5#

So far I've just created an initial GUI which will obviously change as the program evolves(see image below).

By clicking on pieces and squares I can move the pieces on the board. It recognises pawn promotion and offers the choice of piece to promote to. Next I need to devise methods whereby the program can generate a list of its legal moves. From then on it will probably just get harder.

No comments:

Post a Comment