next up previous contents
Next: Appendix 4. Output files Up: No Title Previous: Appendix 2. The two

   
Appendix 3. The Chess Program

The chess game that I made especially for this thesis took about six to seven months to complete and was made from the ground up without being based on any current program. There were different programs written for each of the sections in this paper. The multi strategy is the one that is attached to this thesis. The code was done in C++ and was made to be object oriented. The program works on Windows 9x through the Dos prompt, and is able to play against itself, or play the moves of a chess database. It was found that Borland C++ Builder 5.0's ability to optimise the code for speed, could make it run at least 3 times faster than if it were running on a Linux platform. A chess database can only be read by this program if it is a file of .pgn type. The .pgn file is a file format used by many current chess programs. It should be noted that the format of a .pgn file could be different and that this program expects that there be a 9 to 10 line section that describes the chess game followed by the actual game itself. The fourth line of information should always be the white player and every turn must have a space after the turn number before the move. Eg. 1. e4 c5 and not 1.e4 e5.

There are many forms of notation with most being divided into the two main classes of algebraic or descriptive notation [16]. Each of these classes can be split up into long hand or short hand notation. The long hand notation is where the current position and the subsequent finishing position of a move are recorded. The short hand notation is where only the finishing point and the piece to be moved are recorded. Added information is necessary when more than one chess piece, of the same type, can move to a certain finishing square. Graphical notations for the type of piece also exist. The notation used in the game format for this chess program is short algebraic for reading .pgn files and long algebraic for human use (this is disabled in the version submitted).

The program displays P, R, N, B Q, and K for the white pieces of pawn, rook, knight, bishop, queen and king respectively. The black pieces are represented by [] around the piece name and the blank squares are represented by a dot.

The chess program uses the minimax algorithm but assigns a probabilistic value as well as the value obtained by the attributes. The program will then chose randomly between the moves according to these probabilities. At every ply, the values are calculated and then for each move a probability of it being played is found. The probabilities of every move in that ply are then multiplied by their corresponding evaluation value and then this is backed up to the previous ply. The fifth appendix holds the code for the chess game that uses multiple strategies. This includes the inference that is used for that research. The inference and chess programs vary slightly between the different parts of the research that was done in this thesis.


next up previous contents
Next: Appendix 4. Output files Up: No Title Previous: Appendix 2. The two
Richard A O Wallbrink
2000-11-07