gnugo-devel
[Top][All Lists]
Advanced

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

Re: [gnugo-devel] defend both, attack either, worms[], dragons[]


From: Arend Bayer
Subject: Re: [gnugo-devel] defend both, attack either, worms[], dragons[]
Date: Thu, 12 Dec 2002 12:00:36 +0100 (CET)

Gunnar wrote:

> Arend wrote:
> > >  void
> > >  add_attack_move(int pos, int ww, int code)
> > >  {
> > > +  ASSERT_ON_BOARD1(ww);
> > >    ww = worm[ww].origin;
> > >
> > > -  ASSERT_ON_BOARD1(ww);
> > >    if (code == WIN)
> > >      add_move_reason(pos, ATTACK_MOVE, ww);
> > >    else if (code == KO_A)
> >
> > Hmm, I thought putting the ASSERT afterwards would also catch the cases
> > where (ww) points to an empty point on the board (as worm[].origin will
> > be zero there (and well, if it's way off board, there is at least a
> > very good chance that we will catch it...).
>
> That may be true, but wouldn't it be better to explicitly assert
> IS_STONE(board[ww]) if we want to catch that?

Sure, I was mostly probably to lazy to type this -- feel free to add it ;)

Arend






reply via email to

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