diff --git a/src/TestXBoardProtocol.java b/src/TestXBoardProtocol.java new file mode 100644 index 0000000..724fd97 --- /dev/null +++ b/src/TestXBoardProtocol.java @@ -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; + } + } + } +}