Testing the XBoardProtocol :

this version only answers to 'quit', 'e2e4' and 'd2d4'.

BUG? When using with XBoard, error saying 'broken pipe' after the first move...
This commit is contained in:
2006-01-02 17:40:32 +00:00
parent d2a54faec4
commit 105eb86b85

View File

@ -0,0 +1,36 @@
import java.io.BufferedReader;
import java.io.InputStreamReader;
/**
*
*/
/**
* @author djib
* This class is used to test the XBoard protocol.
*
*/
public class TestXBoardProtocol {
public static void main(String[] args) {
BufferedReader xBoardInput = new BufferedReader(new InputStreamReader(System.in));
while (true) {
try {
String xBoardCommand = xBoardInput.readLine();
//System.err.println(xBoardCommand);
if (xBoardCommand.startsWith("quit")) {
break;
}
if (xBoardCommand.startsWith("e2e4")) {
System.out.println("move b8c6");
}
if (xBoardCommand.startsWith("d2d4")) {
System.out.println("move d7d5");
}
} catch (Exception err) {
break;
}
}
}
}