Metropoli BBS
VIEWER: mlchess.doc MODE: TEXT (LATIN1)
MLChess V1.07
-------------

MLChess is a chess-playing program for the HP48. It is written in a
combination of machine language and System RPL.


License
-------

    MLChess: Machine language chess program for the HP48.
    Copyright (C) 1996  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 mode. (computer plays against itself) Turn off with ON key.
undo	Take back the last half-move.
new	Start a new game.
beep	Toggle the sound on/off.
oppo	Toggle between computer opponent and human opponent.

lev1	Select level 1.
lev2	Select level 2.
lev3	Select level 3.

edit	Edit board position.

The program also understands the following special keys:

DEL	Clear the current input string.
BS	Remove the last character from the input string.
ON	Same as DEL.
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 heuristical 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 it is possible.


Skill levels
------------

The only difference between the three skill levels is the search depth and
the search extension depth.

Level	Depth	ExtDepth
  1	  2	   6
  2	  3	   7
  3	  4	   8

Note that I have not tested level 3 in a complete game, so I don't know
how much time the computer needs to make moves in that level.


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 get very confused if such a position is set up.


The source code
---------------

The program was developed on an Amiga 3000 using the GNU HP tools 2.1.4.
(Available at fly.cc.fer.hr:/pub/hp48/gtools/src/gtools2.1.4.zip)
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 do).

The comments in the source code are mostly in swedish, but I will probably
translate them to english sometime in the future.


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)
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 Österlund 		      Email: peter.osterlund@mailbox.swipnet.se
Sköndalsvägen 35			     f90-pos@nada.kth.se
S-128 66 Sköndal
Sweden
[ RETURN TO DIRECTORY ]