The worst Chess program in the world
Above, you see an applet in working. It plays a game of chess against you. However, this applet plays chess very badly: it just makes the first legal move it sees available!
- To make a move, first (left) click on a piece, and then on its destination square.
- To deselect a piece, (left) click again on the selected piece.
- To castle, (left) click on the king and then on its destination square. The rook moves automatically with it.
- To go back to the original setup, right click on the board.
- The applet checks legality of the moves, including check (with a few exceptions: see `known bugs'). Also, it enforces that white and black alternately make a move, white starting the game.
- The applet does not determine stalemate or mate, draw by repetition, or draw by the 50 moves rule.
- Promotion is automatically to a queen. Minor-promotion is not possible.
- The applet does not detect the end of a game.
- The computer just makes the first legal move he sees. It is actually more difficult to lose from the computer than to win from it.
- The computer only plays black.
VersionThis is version 0.01 of the Chess Play applet. There may not have been a chess program made public that plays as bad as this one. (There could be even worse programs that say they are chess programs, e.g., programs that are so badly written that they always hang, or make illegal moves themselves, etc.)
A puzzleCan you lose from this program? How many move do you need? I can be mated in the sixth move of black. Is this the fastest possible?
Six related solutions to this problem were found (after a request when I had forgotten it) by Alfred Pfeiffer: you can look at them.
PlansImprove the play of the program: use position evaluation, alpha-beta search, hash tables, endgame subroutines... Rewrite it from scratsch, to get code that is less of the mess this code is. Make similar applets for chess variants.
Comments?Comments are appreciated. The source code of a later version can be downloaded from another page.
WWW page and applet by Hans Bodlaender.
WWW page created: March 31, 1997. Last modified: March 15, 1999.