Nick Wedd wrote:
But can GTP actually be used to communicate between two programs?
Not exactly, but you simply setup a "controller" that operates the
game between the programs. Alternatively, you can build the
controller into either of the programs.
Its documentation is remarkably silent on this.
It's documentation does list possible setups and explains their use.
Please read again.
If it can be used to do this, what kind of physical connection does
it require between the two computers?
Whatever sort of connection you like. You can use postal pigeons if
you prefer. All you need is to make sure that programs receive
commands from the controller and the controller gets back their
responses. In UNIX world the natural way is to use stdin/stdout and
redirect them to pipes/sockets/wherever. I believe that some people
reported this is possible on Windows too even if not that easy. Ask
Magnus Persson (sorry if I misspelt the name).
Or maybe it requires both programs to be running on the same
computer?
It does not _require_ single computer, but it is a possible setup.
Naturally, single computer is more accessible than multiple
computers for most people, right? But again, you can connect over
any network as well.
If so, what operating systems can it do this on?
Any. Things are easier on UNIX-like systems, because pipes and
sockets there are well designed (very similar to plain files) and
work out of the box. But any OS should do.
Peter Paul Elfferich wrote:
Apparently go programs supporting GTP communicate through standard
input and output.
This is the standard, but not a requirement. All you need is to make
sure that the controller and the engine can understand each other
(i.e. they can use the same communication channel).
This surprised me since I assumed socket connections would be more
powerful and not that much more difficult to implement.
You can always redirect stdin/stdout to a socket. You can always use
a socket directly as long as the other end uses socket as well.
Search this mailing list's archive for Gunnar's message explaining
how to use `tcputils' for connecting an stdin/stdout program to a
controller server over TCP/IP.
The webpage of the previous link (http://www.lysator.liu.se/~gunnar/gtp/)
also contains links to some scripts to enable two go programs to
talk gtp to eachother. I think these might not work on windows,
since that doesn't have all the nifty pipe support that *nixes have.
I don't know whether those particular scripts work on Windows, but
several people reported that pipes _do_ work under Windows. Working
with pipes from under a portable environment (like Java or certain
scripting languages: Perl, Python etc.) may be easier.
Perhaps there are some programs supporting gtp over socket
connections out there though. That should run fine on all platforms.
Perhaps. But pipes work too.
I know what you need to make GMP work: two systems with serial ports,
two programs that support it, and a serial cable. I have done it
myself.