gnugo-devel
[Top][All Lists]
Advanced

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

[gnugo-devel] worm attributes


From: kevin yong
Subject: [gnugo-devel] worm attributes
Date: Tue, 18 Mar 2003 15:20:36 -0500 (EST)

Hi,
  i test the attributes of worms using following
program:


// 1=INVINCIBLE;
// 1=ALIVE; 2= CRITICAL; 3=UNKNOWN;
void testWormStatus()
{
  int i;
  int origins[BOARDMAX];
  int count;

  getAllWormOrigin(origins,&count);
  for (i=0;i<count;i++) {
    fprintf(zLogFile,"%s %i %i\n", "worm origin i,
      j=",I(origins[i]),J(origins[i]));
    fprintf(zLogFile,"%s %i %i\n", "worm vincible, 
      unconditional_status=",
      worm[origins[i]].invincible,
      worm[origins[i]].unconditional_status);
  }
}


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;
        matched = FALSE;
        for (k=0;k<count;k++) {
          if (origin == origins[k]) {
          matched = TRUE;
          break;
        }
    }
    if (!matched) {
      origins[count++] = origin;
    }
  }
  *_count = count;
}


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])


i got following output:

worm origin i, j= -1 -1
worm invincible, unconditional_status= 0 0
worm origin i, j= 0 16
worm invincible, unconditional_status= 0 3
worm origin i, j= 2 3
worm invincible, unconditional_status= 0 3
worm origin i, j= 5 16
worm invincible, unconditional_status= 0 3
worm origin i, j= 7 18
worm invincible, unconditional_status= 0 3
worm origin i, j= 15 3
worm invincible, unconditional_status= 0 3
worm origin i, j= 15 15
worm invincible, unconditional_status= 0 3


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
    invincible = 1;
    unconditional_status = 1;
by basic rules.

please someone give me some advices on this.
thank you in advance.
best regards.
kevin.


______________________________________________________________________ 
Post your free ad now! http://personals.yahoo.ca




reply via email to

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