[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [gnugo-devel] trevor_1_23.4.tar.gz
From: |
Trevor Morris |
Subject: |
Re: [gnugo-devel] trevor_1_23.4.tar.gz |
Date: |
Sat, 26 Jan 2002 14:00:33 -0500 |
This started out as a private e-mail w/ Dan, but the response
seemed to grow relevant to the devel. list...
At 08:49 AM 1/26/2002 -0800, Dan wrote:
>
>Hi Trevor,
>
>Pattern based tactical reading could be great for finding some
>tesujis and edge moves.
Good! I'm also thinking it might be useful for short-circuiting
possibly long readings. I'm not sure about this, though.
Consider:
?XXX? Crane's next
O...O
.....
?ooo?
:....
?aaa?
B...C
.....
?ooo?
;lib(a) ==3 && neighbors_minlib(a) >= 4 && lib(B) >= 4 && lib(C) >= 4
> defend_result(a, PASS, 0)
> attack_result(a, PASS, WIN)
At 08:49 AM 1/26/2002 -0800, Dan wrote:
>The modification to UPDATE_SAVED_KO_RESULT seems to have no
>effect but makes the macro harder for me to parse.
>...
>
>Which is easier to understand? Of course WIN - KO_B is a synonym for KO_A.
Of course, I find my changed version easier to understand :-).
Yes, they are intended to be identical.
The version that I submitted parallels exactly the MACRO below
it UPDATE_SAVED_KO_RESULT_UNREVERSED. So, it's definitely easier
to parse them both together, because they now look the same.
This also generalizes nicely to:
if (code > savecode) { \
save = move; \
savecode = WIN - code; \
} \
Which is certainly much easier to parse. It also supports
setting WIN higher, to say 255, with KO_A 128 & KO_B 127.
This would give room to play with other ko values for worse
& better kos (two step, internal ko-threats, etc.).
The comments say, "Occasionally savecode WIN is also used".
The macros don't currently support setting this value, though.
>
>> - #define UNUSED(x) x;
>
>Why do you want to change this?
>
>#define UNUSED(x) x=x
>
>is a device to eliminate compiler warnings. Presumably
>this statement is discarded when the compiler optimizes.
>Does defining UNUSED(x) to be x work too?
Yes, I've seen these type of macros defined as "x;" to supress compiler
warnings. Of course, I tested it with the VC compiler, but I can't
be certain it would work on all platforms; it seems cleaner to me.
-Trevor