[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [gnugo-devel] another semeai patch
From: |
sp lee |
Subject: |
Re: [gnugo-devel] another semeai patch |
Date: |
Wed, 14 Jan 2004 22:05:24 -0800 |
> On Wed, 14 Jan 2004, SP Lee wrote:
>
> > Index: owl.c
> > ===================================================================
> > RCS file: /cvsroot/gnugo/gnugo/engine/owl.c,v
> > retrieving revision 1.187
> > diff -u -r1.187 owl.c
> > --- owl.c 7 Jan 2004 10:00:20 -0000 1.187
> > +++ owl.c 14 Jan 2004 22:15:10 -0000
> > @@ -1255,6 +1255,9 @@
> > int k;
> >
> > for (k = 0; k < MAX_MOVES-1; k++) {
> > + /* Eating lunch decreases own liberties during semeai */
> > + if (owl_moves[k].name == "eat lunch")
> > + continue;
>
> This looks wrong. You can't compare a string in this way. Either you
> should use strcmp() or (preferrably) use another way entirely to catch
> this move.
>
> > move = owl_moves[k].pos;
> > if (move == NO_MOVE)
> > break;
> >
>
> -Inge
>
I'm using cygwin and it compiles and runs ok. However, when I changed it
into strcmp like
if (strcmp(owl_moves[k].name, "eat lunch") == 0 && ......
I got a run time error although it compiled ok. So at this moment I don't
have other solution. Any suggestion to avoid string comparison is welcome.
I do have added a constraints to this patch to eliminate the unexpected
fails. After this new patch there is only one pass at semeai:58 and no other
breakage.
SP Lee
$ cvs diff -u owl.c
Index: owl.c
===================================================================
RCS file: /cvsroot/gnugo/gnugo/engine/owl.c,v
retrieving revision 1.187
diff -u -r1.187 owl.c
--- owl.c 7 Jan 2004 10:00:20 -0000 1.187
+++ owl.c 15 Jan 2004 06:01:01 -0000
@@ -1255,6 +1255,11 @@
int k;
for (k = 0; k < MAX_MOVES-1; k++) {
+ /* Eating lunch is only allowed when probable_eye > 1, otherwise it
+ * is considered as reducing own liberties
+ */
+ if (owl_moves[k].name == "eat lunch" && owl_moves[k].value < 76)
+ continue;
move = owl_moves[k].pos;
if (move == NO_MOVE)
break;
- [gnugo-devel] another semeai patch, Paul Pogonyshev, 2004/01/11
- Re: [gnugo-devel] another semeai patch, bump, 2004/01/13
- Re: [gnugo-devel] another semeai patch, bump, 2004/01/13
- Re: [gnugo-devel] another semeai patch, Paul Pogonyshev, 2004/01/14
- Message not available
- Re: [gnugo-devel] another semeai patch, Paul Pogonyshev, 2004/01/14
- Re: [gnugo-devel] another semeai patch, Gunnar Farneback, 2004/01/14
- Re: [gnugo-devel] another semeai patch, SP Lee, 2004/01/14
- Re: [gnugo-devel] another semeai patch, Inge Wallin, 2004/01/14
- Re: [gnugo-devel] another semeai patch,
sp lee <=
- Re: [gnugo-devel] another semeai patch, Gunnar Farneback, 2004/01/17
- Re: [gnugo-devel] another semeai patch, SP lee, 2004/01/20
- Re: [gnugo-devel] another semeai patch, Paul Pogonyshev, 2004/01/20
- [gnugo-devel] a GG3.53 very bad game, max-d, 2004/01/20
- Re: [gnugo-devel] a GG3.53 very bad game, bump, 2004/01/21
- Re: [gnugo-devel] a GG3.53 very bad game, Jens Yllman, 2004/01/26
- Re: [gnugo-devel] a GG3.53 very bad game, Dave Denholm, 2004/01/26
- Re: [gnugo-devel] a GG3.53 very bad game, Jens Yllman, 2004/01/27
- Re: [gnugo-devel] another semeai patch, Gunnar Farneback, 2004/01/20
- Re: [gnugo-devel] another semeai patch, Paul Pogonyshev, 2004/01/14