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: Gunnar Farneback
Subject: Re: [gnugo-devel] defend both, attack either, worms[], dragons[]
Date: Wed, 11 Dec 2002 22:56:53 +0100
User-agent: EMH/1.14.1 SEMI/1.14.3 (Ushinoya) FLIM/1.14.2 (Yagi-Nishiguchi) APEL/10.3 Emacs/20.7 (sparc-sun-solaris2.7) (with unibyte mode)

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?

/Gunnar



reply via email to

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