Home

LaMoSca v0.03

The WinBoard interface

Objective

PositionIn this version the program is developed to use WinBoard as its user interface.

This means that command input has to be changed so that game input can come not only from the computer console but also through the interface's protocol. In addition, the software must be able to generate moves on its own in order to start playing chess, even if with limited abilities.

Using the program

Configuring WinBoard

The engines that WinBoard can use are described in the file "winboard.ini". If the software has been compiled in the directory "C:\Programmi\LaMoSca\" of the computer, the configuration file will have to be updated with entries like these:

/firstChessProgramNames={GNUChess
"GNUChes5 xboard"
"wcrafty-18.10.exe log=off" /fd="C:\Programmi\Crafty\"
"LaMoSca" /fd="C:\Programmi\LaMoSca\"
}
/secondChessProgramNames={GNUChess
"GNUChes5 xboard"
"wcrafty-18.10.exe log=off" /sd="C:\Programmi\Crafty\"
"LaMoSca" /sd="C:\Programmi\LaMoSca\"
}

Running from the command line

You can write a batch file that runs WinBoard and passes the engine information as parameters. A command for batch execution could look like this:

C:\Programmi\Winboard\Winboard -debug /cp /fcp="wcrafty-18.10.exe log=off" /fd="C:\Programmi\Crafty" /scp="LaMoSca" /sd="C:\LaMosca\"

Note the "-debug" parameter, which makes WinBoard write the file "winboard.debug", containing all the information exchanged during the game through the protocol between the interface and the chess programs.

The code

The WinBoard protocol

The information exchanged between WinBoard and the engines follows a protocol that defines the allowed commands and their format. The protocol has several versions, but the program uses the first one, which is the simplest.

The main sequence of commands is the one that starts the engine at the beginning of the game:

  • xboard: switches the protocol on;
  • new: resets the position of the pieces on the board;
  • force: holds the software while its configuration is completed;
  • black or white: sets the colour the program plays;
  • go: starts the software.

During the game the opponent's moves (a human or a second engine) are passed by the interface as coordinates (e.g. "e2e4"), while the engine sends its own moves with the move command (e.g. "move e2e4").

edit
#
Nc4
Pd4
Kd2
c
Nd7
Ke7
Pe5
.

Another useful instruction for debugging is the edit command, which sets up the board in a specific position, typically to reproduce game situations in which errors occurred. With WinBoard, positions stored in ".fen" files can be loaded from the menu "File" - "Load Position ...". For the position shown in the picture, the output sent to the chess program, which can be read in the file "winboard.debug", is shown alongside.

The same sequence of commands can also be passed to the software from the computer console (without WinBoard), either by typing it or by copying and pasting it.

Generating the program's moves

Until an evaluation function is written to choose the most suitable move according to the position of the pieces on the board, the chess program's moves are for now chosen at random among the possible pseudo-legal ones.

Download

LaMoSca03.zip (5.58 k)

To be completed

  • generation of legal moves;
  • detection of drawn positions;

To do

  • evaluation of positions;
  • analysis of the opponent's replies.

Links


Back Index Next