Since we have the copyright problems with twogmp.c, here is a small perlscript twogtp.pl. It is definitely simpler to run two programs against each other in gtp than gmp: the script is almost trivial. It also works with cygwin on windows. It would be nice to have a script that comes with gnugo and can run gtp matches out of the box. run with: perl --white 'gnugo1 --mode gtp --quiet' --black 'gnugo2 --mode gtp --quiet' Teun --------------B418AC38F6EDA01420321D12 Content-Type: application/x-perl; name="twogtp.pl" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="twogtp.pl" use IPC::Open2; use Getopt::Long; use FileHandle; my $white; my $black; my $size = 9; my $verbose = 0; my $komi = 5.5; my $handicap = 0; GetOptions( "white|w=s" => \$white, "black|b=s" => \$black, "verbose|v=i" => \$verbose, "komi|km=f" => \$komi, "handicap|ha=i" => \$handicap, "size|s=i" => \$size ); die "Please specify white gtp player\n" unless defined $white; die "Please specify black gtp player\n" unless defined $black; my @handi; # position of handicap stones push @handi, ( 1,-1); push @handi, (-1, 1); push @handi, ( 1, 1); push @handi, (-1,-1); push @handi, ( 0, 1); push @handi, ( 0,-1); push @handi, ( 1, 0); push @handi, ( 0, 1); push @handi, ( 0, 0); my @handicap; # handicap stones push @handicap, (0); push @handicap, (0,1); push @handicap, (0,1,2); push @handicap, (0,1,2,3); push @handicap, (0,1,2,3,8); push @handicap, (0,1,2,3,4,5); push @handicap, (0,1,2,3,4,5,8); push @handicap, (0,1,2,3,4,5,6,7); push @handicap, (0,1,2,3,4,5,6,7,8); # create FileHandles #my $black_in; my $black_in = new FileHandle; # stdin of black player my $black_out = new FileHandle; # stdout of black player my $white_in = new FileHandle; # stdin of white player my $white_out = new FileHandle; # stdout of white player $pidb = open2($black_out, $black_in, $black); print "black pid: $pidb\n" if $verbose; $pidw = open2($white_out, $white_in, $white); print "white pid: $pidw\n" if $verbose; print $black_in "boardsize $size\n"; eat_no_response($black_out); print $black_in "komi $komi\n"; eat_no_response($black_out); print $white_in "boardsize $size\n"; eat_no_response($white_out); print $white_in "komi $komi\n"; eat_no_response($white_out); my $pass = 0; my $move; my $toplay = 'B'; while ($pass < 2) { if ($toplay eq 'B') { print $black_in "genmove_black\n"; $move = eat_move($black_out); print "Black plays $move\n" if $verbose; if ($move =~ /PASS/i) { $pass++; } else { $pass = 0; } print $white_in "black $move\n"; eat_no_response($white_out); if ($verbose > 1) { print $white_in "showboard\n"; eat_no_response($white_out); } $toplay = 'W'; } else { print $white_in "genmove_white\n"; $move = eat_move($white_out); print "White plays $move\n" if $verbose; if ($move =~ /PASS/i) { $pass++; } else { $pass = 0; } print $black_in "white $move\n"; eat_no_response($black_out); if ($verbose > 1) { print $black_in "showboard\n"; eat_no_response($black_out); } $toplay = 'B'; } } print $white_in "new_score\n"; $resultw = eat_score($white_out); print "Result according to W: $resultw\n"; print $black_in "new_score\n"; $resultb = eat_score($black_out); print "Result according to B: $resultb\n"; print $white_in "quit\n"; print $black_in "quit\n"; sub eat_no_response { my $h = shift; my $line; $line = <$h>; die "No response!\n" unless (defined $line); $line = <$h>; } sub eat_move { my $h = shift; my $line; $line = <$h>; die "No response!\n" unless (defined $line); $line =~ s/\s*$//; my ($equals, $move) = split(' ', $line, 2); $line = <$h>; return $move; } sub eat_score { my $h = shift; my $line; $line = <$h>; die "No response!\n" unless (defined $line); $line =~ s/\s*$//; my ($equals, $result) = split(' ', $line, 2); $line = <$h>; return $result; }