TesujiGoFramework/WorkWithGoGui

Sub-page of TesujiGoFramework

Making it work with GoGui

There are some really basic building blocks in the project so far and with the addition of the RandomGoEngine you may think we should be ready to actually make something work. With Go programming you will inevitably want to let people play against it. Or maybe you'd want to let it play against other programs. However, making a good user-interface for a Go playing program is a daunting task by itself. If you're anything like me you probably prefer to focus on the playing algorithms and data-structures rather than busying yourself with mouse-clicks and drawing lines on the screen. Fortunately there's a way around programming this all yourself, and that is use somebody else's front-end. Like GoGui. As presented in the previous section, any front-end supporting GTP can be used to let our GoEngine implementations play.

First, let me stress that GoGui is distributed under the GPL license. This is a license that is not compatible with the MIT-type license under which this project is distributed. However, that does not need to be an insurmountable obstacle. Thanks to the GTP protocol and the fact that GoGui supports it, it can be used side-by-side with a separate Go playing engine, as long as it adheres to GTP as well. This project may at some point in time have its own front-end, but for the time being we can make use of other open-source projects to bootstrap our project.

For GoGui, its documentation and project pages, go here: [ext] http://gogui.sourceforge.net/

There's a class called RandomGoEngineGTPTest that has a main-method that can be used to start the RandomGoEngine. This may be a good moment to download the Fat-Jar plugin to Eclipse. This plug-in makes it very easy to create a .JAR file containing all the classes you program needs and save it at a place of your choice. Simply add the following link to your Eclipse update sites: [ext] http://kurucz-grafika.de/fatjar

If you use it so create a .JAR file, say TesujiGoFramework.jar, then the program is started with the following command-line 'java -cp TesujiGoFramework.jar tesuji.games.go.test.RandomGoEngineGTPTest'. You will probably have to put the path to the directory where this .jar file resides in front of the .jar name in the command-line. When you do this, it may seem nothing happens. If you type a GTP command however, the engine will respond. If you type 'name' for example, it will respond with "= RandomGo". You're not going to communicate with your program this ay of course, but it's a quick way to see if it works. Try typing 'list_commands'.

OK, if you get a nice list of commands, it's time to fire up GoGui. When it's started, choose 'File -> Attach Program....' and fill the same command-line you used in the command-line box. GoGui should respond by placing the name of the Go engine in the window-title, in this case "RandomGo". Click to enter a move for Black and RandomGo will respond by placing a white stone on the board. At a random spot of course, but we're playing!

OK, OK let me temper your enthusiasm a bit here. That we're playing means very little. How many bugs have just been created in all this code? You can be sure there are plenty. So how do we find them? Check out the Unit Test page just for starters. If you find that all too boring, you can skip it and go to the next building block of course.


This is a copy of the living page "TesujiGoFramework/WorkWithGoGui" at Sensei's Library.
(OC) 2014 the Authors, published under the OpenContent License V1.0.
[Welcome to Sensei's Library!]
StartingPoints
ReferenceSection
About