The Chess Variant Pages



The worst Chess program in the world

This only works with Java enabled browsers.

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!

  1. To make a move, first (left) click on a piece, and then on its destination square.
  2. To deselect a piece, (left) click again on the selected piece.
  3. To castle, (left) click on the king and then on its destination square. The rook moves automatically with it.
  4. To go back to the original setup, right click on the board.
  5. 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.
  6. The applet does not determine stalemate or mate, draw by repetition, or draw by the 50 moves rule.

Known bugs

  1. Promotion is automatically to a queen. Minor-promotion is not possible.
  2. The applet does not detect the end of a game.
  3. 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.
  4. The computer only plays black.

Version

This 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 puzzle

Can 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.

Plans

Improve 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.