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: Holger
Subject: Re: [Bug-gnubg] A question - Which die is still available during a move? - and a request
Date: Mon, 10 Feb 2003 23:51:55 +0100

On Mon, 10 Feb 2003 19:11:38 +0100, Jim Segrave wrote:
> On Mon 10 Feb 2003 (17:57 +0100), Holger wrote:
> > 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? :-)

Not that I'd thought of, at least not in the quoted part. The snipped
rest is another issue. :-)
Sorry, if I wasn't clear. I just wanted to ask whether there is
already exactly what I'd need. If there isn't, bad luck for me.
But better to ask before than doing all the work only to find that it
had been done already. And I didn't mean to ask for a guided tour on
how to code this. I did have some ideas.

> 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.

Thank you for your hints.

Regards,

        Holger




reply via email to

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