gnugo-devel
[Top][All Lists]
Advanced

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

Re: [gnugo-devel] Semeai weirdness.


From: bump
Subject: Re: [gnugo-devel] Semeai weirdness.
Date: Fri, 14 Feb 2003 16:47:21 -0800

> Apparently the function new_semeai() in semeai.c is responsible for
> this. It's not very easy to read but it seems clear that it's not
> symmetrical with respect to the color to move. I'm also fairly certain
> that the declarations of a_status and b_status on lines 247 and 248
> are buggy since they shadow an earlier declaration of the same
> variables at the top of the function. As a result the if statements on
> lines 232 and 238 can never be true.

Something looks wrong here. 

Part of the complexity of the function is caused by the fact that a dragon may
be involved in several semeais. We need to collect results for the
different semeai, analyze this information, then update statuses.

We have a loop beginning at line 138 and within this loop, apos
and bpos are basically constant. That loop ends on line 245.

Now apos (the first dragon) is basically constant on the loop
beginning at line 120 and ending at line 271. The statuses are
updated inside this loop, but outside the inner loop where
bpos is held fixed.

So it looks wrong to update the b status at line 268, since
this is outside the loop where the b dragon is held constant.

As Gunnar points out, the function is not easy to read.

Dan




reply via email to

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