gnugo-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [gnugo-devel] huh, wtf?


From: Gunnar Farneback
Subject: Re: [gnugo-devel] huh, wtf?
Date: Sat, 21 Jun 2003 23:54:57 +0200
User-agent: EMH/1.14.1 SEMI/1.14.3 (Ushinoya) FLIM/1.14.2 (Yagi-Nishiguchi) APEL/10.3 Emacs/20.7 (sparc-sun-solaris2.7) (with unibyte mode)

Paul wrote:
> can anyone explain me this piece of code (interface/play_gtp.c, 
> around lines 2690, finish_and_score()):
> 
>   do {
>     move_val = genmove_conservative(&i, &j, next);
>     play_move(POS(i, j), next);
>     if (move_val >= 0) {
>       pass = 0;
>       moves++;
>     }
>     else
>       pass++;
> 
>     next = OTHER_COLOR(next);
>   } while (pass < 2 && moves < board_size * board_size);
> 
> what does `moves' serve for?

Isn't that obvious? It breaks the loop in case some bug should cause
GNU Go to play on forever, e.g. getting stuck in a triple ko. Limiting
the number of moves to the number of vertices on the board is of
course arbitrary but large enough not to happen in practice (in
absence of bugs) and small enough to guarantee ending the scoring in
reasonable time.

/Gunnar




reply via email to

[Prev in Thread] Current Thread [Next in Thread]