gnugo-devel
[Top][All Lists]
Advanced

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

Re: [gnugo-devel] worm attributes


From: Gunnar Farneback
Subject: Re: [gnugo-devel] worm attributes
Date: Wed, 19 Mar 2003 19:12:05 +0100
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)

Kevin wrote:
> int getAllWormOrigin(int origins[], int *_count)
> {
>   int i,j,k;
>   int origin;
>   BOOL matched;
>   int count = 0;
>         
>   for (i=0;i<BOARDMAX;i++) {
>     if (board[i] == EMPTY) continue;
>       origin = worm[i].origin;

I recommend using the standard form of this loop,

  for (i = BOARDMIN; i < BOARDMAX; i++)
    if (!ON_BOARD(i) || board[i] == EMPTY)
      continue;

or the equivalent

  for (i = BOARDMIN; i < BOARDMAX; i++)
    if (!IS_STONE(board[i]))
      continue;

to avoid inspecting the worm array for indices corresponding to out of
board markers.

> on the following .sgf file:
> 
> (;GM[1]FF[4]
> SZ[19]
> GN[GNU Go 3.3.16 Random Seed 1048015617 level 10]
> DT[2003-03-18]
> KM[5.5]AP[GNU Go 3.3.16]RU[Japanese]HA[0]
> ;B[qa];W[qf];B[qe];W[qg];B[qd];W[qh];B[qc];W[qi];B[qb];W[rf];B[re]
> ;W[sf];B[se];W[ri];W[qj];B[pp];W[rj];B[qp];W[sj];B[rc];W[sh];B[sc]
> ;W[dp])

For mail discussion it helps to accompany the sgf file with an ascii
view of the board. A simple way to get one is to start GNU Go in GTP
mode and issue a loadsgf command followed by showboard.

   A B C D E F G H J K L M N O P Q R S T
19 . . . . . . . . . . . . . . . . X . . 19
18 . . . . . . . . . . . . . . . . X . . 18
17 . . . . . . . . . . . . . . . . X X X 17
16 . . . + . . . . . + . . . . . + X . . 16
15 . . . . . . . . . . . . . . . . X X X 15
14 . . . . . . . . . . . . . . . . O O O 14
13 . . . . . . . . . . . . . . . . O . . 13
12 . . . . . . . . . . . . . . . . O . O 12
11 . . . . . . . . . . . . . . . . O O . 11     WHITE has captured 0 stones
10 . . . + . . . . . + . . . . . + O O O 10     BLACK has captured 0 stones
 9 . . . . . . . . . . . . . . . . . . . 9
 8 . . . . . . . . . . . . . . . . . . . 8
 7 . . . . . . . . . . . . . . . . . . . 7
 6 . . . . . . . . . . . . . . . . . . . 6
 5 . . . . . . . . . . . . . . . . . . . 5
 4 . . . O . . . . . + . . . . . X X . . 4
 3 . . . . . . . . . . . . . . . . . . . 3
 2 . . . . . . . . . . . . . . . . . . . 2
 1 . . . . . . . . . . . . . . . . . . . 1
   A B C D E F G H J K L M N O P Q R S T

> The point is:
>   all worms are reported 
>     invincible = 0;
>     unconditional_status = 3;
>   but if you look at .sfg file, 2 worms at the
> lower-left coner of the board should be

You have your coordinate system wrong. The worms in the upper right
look like the interesting ones.

>     invincible = 1;
>     unconditional_status = 1;
> by basic rules.

No, those are not invincible. They are certainly alive under
alternating play and even so strongly alive that there isn't even a
(direct) ko threat against them. But an invincible worm is something
different. The GNU Go documentation says:

  @cindex invincible worm
  An @dfn{invincible} worm is one which GNU Go thinks
  cannot be captured. Invincible worms are computed by the
  function @code{unconditional_life()} which tries to
  find those worms of the given color that can never be captured,
  even if the opponent is allowed an arbitrary number of consecutive
  moves.

The main point is that the opponent should not be able to capture the
worm, even if allowed an arbitrarily large number of consecutive
moves. To demonstrate that the R19 worm is not invincible, white can
play 9 consecutive moves to reach this position

   A B C D E F G H J K L M N O P Q R S T
19 . . . . . . . . . . . . . . . O X O . 19
18 . . . . . . . . . . . . . . . O X O O 18
17 . . . . . . . . . . . . . . . O X X X 17
16 . . . + . . . . . + . . . . . O X . O 16
15 . . . . . . . . . . . . . . . O X X X 15
14 . . . . . . . . . . . . . . . . O O O 14
13 . . . . . . . . . . . . . . . . O . . 13
12 . . . . . . . . . . . . . . . . O . O 12
11 . . . . . . . . . . . . . . . . O O . 11     WHITE has captured 0 stones
10 . . . + . . . . . + . . . . . + O O O 10     BLACK has captured 0 stones
 9 . . . . . . . . . . . . . . . . . . . 9
 8 . . . . . . . . . . . . . . . . . . . 8
 7 . . . . . . . . . . . . . . . . . . . 7
 6 . . . . . . . . . . . . . . . . . . . 6
 5 . . . . . . . . . . . . . . . . . . . 5
 4 . . . O . . . . . + . . . . . X X . . 4
 3 . . . . . . . . . . . . . . . . . . . 3
 2 . . . . . . . . . . . . . . . . . . . 2
 1 . . . . . . . . . . . . . . . . . . . 1
   A B C D E F G H J K L M N O P Q R S T

and then capture the R19 worm by a tenth consecutive move at S16.

Similarly black can surround the R14 worm on the outside, play T13 +
S12, capture one stone with T11, and finally capture the big R14 worm
with S13.

I should also mention that GNU Go has a different and less strict
concept of invincible dragons. That requires the dragon to either
include at least one invincible worm or to have a sufficient amount of
distinct and definite eyes. The idea there is to identify dragons
which (under alternating play) are safe enough that GNU Go shouldn't
have to worry about them in any way, with a substantial margin for
errors in GNU Go's analysis.

/Gunnar




reply via email to

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