MLChess V1.14 ------------- MLChess is a chess playing program for the HP48/HP49. It is written in a combination of machine language and System RPL. MLChess works with all models of HP48 and HP49 calculators. License ------- MLChess: Machine language chess program for the HP48/HP49. Copyright (C) 1996-2000 Peter Österlund. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. Playing ------- A move is entered as a 4-letter string, i.e. e2e4 followed by ENTER. In addition to legal moves you can also type one of the following commands: swap Rotates the board 180 degrees. quit Quit program. load Load a game from the top level of the stack. save Save the current game to the stack. go Make the computer do one move. (Use this to play black.) auto Start auto play mode. The computer plays against itself. To stop auto mode hit the ON key, and wait for the current move to finish. undo Take back the last half-move. redo Redo the most recently undone haft-move. strt Take back all moves. new Start a new game. beep Toggle the sound on/off. oppo Toggle between computer opponent and human opponent. pset Toggle between two different sets of chess pieces. lev1 Select level 1. lev2 Select level 2. lev3 Select level 3. lev4 Select level 4. lev Display current level. edit Edit board position. Entering an empty line repeats the previous command. The program also understands the following special keys: ON Clear the current input string. BS Remove the last character from the input string. DEL Same as ON. (HP48 only) OFF Turn the calculator off. The program correctly handles castling, en passant moves and pawn promotion. It does not, however, handle draw by repeated position and draw by the 50-move rule. Algorithm --------- The program uses the negamax algorithm with alpha-beta cutoff. The search depth is set to 2 PLY with depth-extension on capture moves (up to 6 PLY). (Note: This is true only for level 1.) The static position evaluation is based on quite a few heuristic rules. Most of them are simplified versions of heuristics taken from the GnuChess program. Look at the file stateval.s for details. In spite of the quite advanced heuristics, the program still plays very bad because of the low search depth. (It can't even find a mate-in-one on level 1, unless it is lucky.) On level 2 the program will always find a mate-in-one, and on level 3 the program will always avoid a mate-in-one by the opponent if at all possible. Skill levels ------------ The only difference between the four skill levels is the search depth and the search extension depth. Level Depth ExtDepth 1 2 6 2 3 7 3 4 8 4 5 9 Note that I have not tested level 3 and 4 in a complete game, so I don't know how much time the computer needs to make moves in those levels. Editing board positions ----------------------- The edit command starts the edit mode. In this mode the program understands the following commands: c Change color. e Erase board. quit Leave edit mode. Psq Put piece P on square sq. P is one of x,p,n,b,r,q,k. (x = empty) Note: When you enter edit mode, the move count restarts at 001, and you will not be able to take back any previous moves. You should not set up illegal positions (more than one king for each side, pawns on 1:st or 8:th rank, etc.) The program does not check for illegal positions, but it will probably get very confused if such a position is set up. The source code --------------- The program (up to version 1.07) was developed on an Amiga 3000 using the GNU HP tools 2.1.4. Currently, the program is developed on a Dell Dimension XPS Pro 200n running Linux 2.0.28. All source files were compiled with RPLCOMP and SASM. To compile the support program needed to generate the binary opening book, you will also need gcc. (Or maybe some other C compiler will also work). Credits ------- I wish to thank the following people (in alphabetical order): Richard Backman : Bug report, test play, general good ideas. Paul Dale : I used the graphics from his chess program on Goodies disk #6. Francesco Ferrara : Suggested auto play mode. Michael Heinz : Test play, suggested randomness in evaluation function. Mika Heiskanen : GX compatibility, lots of programming tricks. Author ------ Please send me suggestions or bug reports, preferably by email. -- Peter Osterlund - petero2@telia.com http://w1.894.telia.com/~u89404340