Working with the Checkers applet

The Checkers applet enables running a heuristic position evaluation function for the game of checkers, using the MIN-MAX algorithm. The applet provides the user interface to control the settings and the course of the game, the basic minimax algorithm, and also enforces the rules of the game (below). The applet requires Java JRE packages, and JDK to be installed on your system.

Game rules

The applet implements a variant of checkers with the following rules:

Heuristic function API

The interface of the heuristic function required by an applet, is described in the comment of a sample function, which can be loaded into the editor while running the applet (both Java and Javascript).

User Interface

Game modes
Game modes are selected separately for the top and bottom player.

Board position
It is possible to turn the board around by clicking 'Turn board around'.

The level of analysis
The box 'Level' allows you to choose the level of computation in the Min-Max algorithm.

Running tests
A series of games can be run in sequence by setting the value of 'Number of tests'.

Starting/Stopping the game
The 'Play'/'Pause' enables to run the algorithm for the preset game parameters.

Animation
The applet allows to view a simulation game in several modes:

The speed of the game
Changing the speed of the game is possible using the box 'game speed'.

Event Log
In the bottom left of the applet's display area is the space for showing the events of the game. The log can be enabled ('Log' set to 'on') or disabled ('Log' set to 'off'). It is possible to record the event log on a file. To do this, select 'save' from the 'Log' menu.

Board editor
Clicking on 'Edit board' enables one to set the initial state of the game. In the course of defining this state, all pieces' color and rank can be set (box 'Color' and 'Figure').

Function Editor
The text box to the right of the applet makes it possible to write user position evaluation functions.

File Operations
During the operation of the applet up to two user functions (Java or Javascript) can be loaded and active. A user can create and use more functions, but they have to be saved to and loaded from disk files with the following operations:

Solutions to problems

In case of problems with compiling Java files on Windows (a 'javac' program is required when applying the user functions), the environment variable PATH must be properly set (no need to remove the defined paths, just add a new one after a semicolon). A quick guide can be found here:
http://tomasz.topa.pl/java/java-dodawanie-zmiennej-srodowiskowej-path

After adding an environment variable, restart the computer in order to load the changes. If it is still not possible to compile the file, it means that the error may be caused by the applet previously placed in the cache. Then, follow these steps:

Note!

In the case of errors in the applet log related to the IO access - 'acces denied', which may occur when:

the applet can be run from the console (command line) by entering this command:

appletviewer -J-Djava.security.policy=http://sequoia.ict.pwr.wroc.pl/~witold/ai/Checkers/java.policy.applet http://sequoia.ict.pwr.wroc.pl/~witold/ai/Checkers/