[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gnugo-devel] `twogtp.pike' patch
From: |
Paul Pogonyshev |
Subject: |
[gnugo-devel] `twogtp.pike' patch |
Date: |
Thu, 15 Jan 2004 00:14:10 +0000 |
User-agent: |
KMail/1.5.94 |
This patch makes the script write out full SGF record of the current
game after each move, per request of Gunnar.
Paul
--- twogtp.pike.~1.6.~ 2003-11-30 23:57:02.000000000 +0000
+++ twogtp.pike 2004-01-15 00:06:56.000000000 +0000
@@ -675,9 +675,11 @@ class GtpGame {
white->reset_engine();
black->reset_engine();
+ territory = UNDEFINED;
array error = catch {
- for (int passes = 0; passes < 2;) {
+ int passes = 0;
+ while (1) {
player = black_to_play ? black : white;
opponent = black_to_play ? white : black;
@@ -707,7 +709,9 @@ class GtpGame {
if (move_lower_case == "pass") {
if (verbose)
werror(player->capitalized_color + " passes\n");
- passes++;
+
+ if (++passes == 2)
+ break;
}
else {
if (verbose) {
@@ -729,6 +733,8 @@ class GtpGame {
werror(board + "\n");
}
black_to_play = !black_to_play;
+
+ write_sgf_file(sgf_file_name, sgf_moves, ({ "Void" }));
}
};
@@ -736,7 +742,6 @@ class GtpGame {
black->finalize_time_control();
array(string) result;
- territory = UNDEFINED;
if (error) {
result = ({ "Void", error[0] });
werror("The game will be saved in file `%s'.\n", sgf_file_name);
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [gnugo-devel] `twogtp.pike' patch,
Paul Pogonyshev <=