/*
* Jess.java
*
* Created on 26. november 2004, 10:10
*/
package checkers;
import jess.*;
/**
* Jess player
* @author k380h11
*/
public class Jess extends Player {
/**
* Creates a new instance of Jess
* @param id name of the player
* @param color color of the player
*/
public Jess
(String id,
boolean color
) {
super(id, color);
}
/**
* This method is used start the Jess program
*/
public void play() {
try {
Checker.r.reset();
for (int i=0 ; i< 3; i++) {
String turn
= Boolean.
toString(Checker.
getInstance().
getTurn()).
toUpperCase ();
Checker.r.executeCommand("(assert (deepness "+ i +" "+ turn +"))");
Checker.r.executeCommand("(focus MOVEMENT)");
Checker.r.executeCommand("(run)");
turn
= Boolean.
toString(!Checker.
getInstance().
getTurn()).
toUpperCase ();
Checker.r.executeCommand("(assert (deepness "+ i +" "+ turn +"))");
Checker.r.executeCommand("(focus MOVEMENT)");
Checker.r.executeCommand("(run)");
}
Checker.r.executeCommand("(focus REASONING)");
Checker.r.executeCommand("(assert (find_max -1000))");
Checker.r.executeCommand("(run)");
sleep(500);
}
}
}