Sunday 1 February 2015

Tiny, tiny

A claim concerning the smallest chess program ever written has been in the news recently. Bootchess clocks in at under 512 bytes, which is smaller than the chess program written for the ZX81 back in 1982.
If you are keen you can even read the source code here, but the program does come with a couple of caveats. It apparently does not play all the legal moves in chess, with no castling and no underpromotion. I also could not find a mention of en-pas in the source, but it may be hidden in there somewhere.
As for the level of play I'm guessing it is pretty basic, given the program size. Based on the comments in the code it seems to value moves that get pieces closer to the opponents king at the top, after it looks for the best capture. It does not seem to have a look ahead, so its play might is at the beginner level ('that move looks nice. I will do that')
There is of course the quibble that it isn't a full chess program. But if my unreliable memory is correct, there may have been some missing features in the ZX81 program as well. If it is that big a problem though, a solution may not be far away as the author is allowing anyone else to modify the program (possibly to shrink it further), as long as attribution is given.

No comments: