bug-gnubg
[Top][All Lists]
Advanced

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

Re: [Bug-gnubg] A question - Which die is still available during a move?


From: Jim Segrave
Subject: Re: [Bug-gnubg] A question - Which die is still available during a move? - and a request
Date: Mon, 10 Feb 2003 19:11:38 +0100
User-agent: Mutt/1.4i

On Mon 10 Feb 2003 (17:57 +0100), Holger wrote:
> Hi,
> 
> I'm trying to write a feature that helps users new to backgammon by
> indicating the possible target points for a move.
> 
> What I still need to know is whether there has been moved already a chequer
> and with which die. Are there any variables (or functions) that hold
> information about which die/dice were already used and which are still 
> available
> during a move? It should be accessible from within board_pointer() in 
> gtkboard.c.
> I hope that some information about this is already kept, else I'd need to
> add some bookkeeping logic.

Hmm - you don't ask much, do you? :-)

But you might take a look at the pip counts. If you have the pip count
before a roll, then as chequers are moved (or put back), the count
changes to reflect what's been used. From that, you can determine if
any move has been made and if there's any unused movement left in the
dice (although it won't tell you that you have no further legal moves
left). This also works with doubles. 

Call PipCount() in eval.c just after the player rolls in CommandRoll()
and save it somewhere. Anytime you need to know if there's anything
used/left to play, call PipCount() again and compare the values.

-- 
Jim Segrave           address@hidden




reply via email to

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