BenLo Park
Microchess
Back
Next
Contact

My System

I knew very little about how to go about writing a chess playing program. A few years before, an article had appeared in Scientific American which discussed the state of chess playing programs at the time. Some sample code in ALGOL was shown. I had saved the article with the idea that some day I would have access to a computer so that I could try my hand at this programming challenge.

With the limited memory and processing power of the Kim-1, I spent a lot of time experimenting with different methods of encoding the positions of the pieces on the board. It was clear that I could not afford to store multiple copies of the board as pieces were moved, and that the calculation of piece moves would have to be as efficient as possible.

After a lot of trial and error and some rigorous analysis, I settled on a state machine design, which allowed the use of recursion to work through the advancing positions as moves were generated and evaluated. A move stack allowed the retracing of moves back to the original position.

After each move was generated, an evaluation routine was called to determine the value of the resulting position. Values of move chains were compared. Having a completely independent evaluation routine made it possible to experiment endlessly with different parameters and methods of valuing positions.

The chess knowledge embedded in the evaluation was almost entirely derived from the book My System by Aron Nimzovich. First published in 1930, and revised in 1947, this book is still one of the most recommended guides to chess strategy for players and chess programmers of every level. There is now a recent release of the book by Lou Nimzowitsch and Lou Hays: My System: 21st Century Edition.

  

The dog eared 1964 copy of My System I still have is marked up with a yellow highlighter pen. Each mark is a rule to be followed by a good chess player as enunciated by Nimzovich. Some of the key rules made it into the first version of Microchess. Subsequent versions of Microchess encoded more and more of this fine book into code.

Week by week, the program progressed. At first, it would make legal moves, but they didn't make much sense. The first time I demonstrated it to my brother-in-law, it insisted on marching all of its pawns down the board as quickly as possible, regardless of any other positional strategy.

Night after night, I would stay up as long as I could keep my eyes open, playing games against the steadily improving Microchess. Every time it would make what appeared to be a mistake, I would stop the program and examine the rules and evaluation scores which had caused it to select the poor move over the obviously better one. Then, I would make a change to the program, replace the pieces, and start again.

More about Microchess and the Kim-1