maandag 29 juli 2013

Current status

In its current state ChessJvO features the following components:
Some additions I'd like to add are:

Java for XBoard


The chess engine I'm working on is written in Java and is only an engine. For now I'm using XBoard as the GUI for the engine. (WinBoard to be precise, since I'm on a Windows machine.)

XBoard expects a link to an exe for its engines and my Java engine is actually a jar file. At first I looked at an exe wrapper for jar files (Launch4j), but this was not successful. I use this line to the engine in XBoard now:
"Chess JvO" -fcp "java -cp D:\ChessJvO\ChessJvO.jar ChessJvO"
The only downside to this is that the engine is now named "java" instead of "ChessJvO" in XBoard, but it works fine.

Communication with XBoard goes through standard in and out, which are System.in and System.out in java. It seems they are unbuffered by default in Java, so setting up the communication is quite easy. Output is simply sent to System.out and the input can be set up as follows:

BufferedReader input = new BufferedReader(new InputStreamReader(System.in));
try {
   for (;;) {
      String command = input.readLine();
      if (command == null) return;
      handleCommand(command);
   }

} catch (IOException e) {
   e.printStackTrace();

}

More information on the communication protocol with XBoard can be found on the page about the Chess Engine Communication Protocol.

ChessJvO


A few weeks ago I started writing a simple chess playing engine for fun. During the development I ran into some issues, so I started this blog to share some of my findings. I've named the engine ChessJvO for now. It is written in Java and is currently playing some matches against itself.

Good places for general information about chess programming concepts is Wikipedia. More detailed information can be found on The Chess Programming Wiki.

I did however still ran into problems from time to time, so I hope this blog can help others to prevent these problems.