~ubuntu-branches/ubuntu/oneiric/dds/oneiric

« back to all changes in this revision

Viewing changes to debian/SolveBoard.3

  • Committer: Bazaar Package Importer
  • Author(s): Christoph Berg
  • Date: 2010-05-23 11:56:03 UTC
  • mfrom: (1.1.5 upstream)
  • Revision ID: james.westby@ubuntu.com-20100523115603-x0anrw9iv5uap6w1
Tags: 2.0.1+ddd105-1
* New dds upstream version, in some situations
  dds could wrongly reuse the transposition table contents giving an
  incorrect result.
* Defines DDS_VERSION.

Show diffs side-by-side

added added

removed removed

Lines of Context:
70
70
Return all cards that can be legally played with their scores in descending  order.
71
71
.PP
72
72
 
73
 
Parameter ”\fImode\fP” defines the DLL mode of operation. This mode does not affect the DLL if there are multiple choices for cards to play. If there is just one card to play, or multiple cards that are all equivalent, this mode determines  whether or not the DLL will search to find the score.
 
73
Parameter ”\fImode\fP” defines the DLL mode of operation.
74
74
.TP
75
75
.B mode=0
76
 
Do not search to find the score if the hand to play has only one card, including its equivalents, to play. Score is set to -2 for this card, indicating that there are no alternative cards. This mode is very fast but you don’t
 
76
Do not search to find the score if the hand to play has only one card, including its equivalents, to play. Score is set to -2 for this card, indicating that there are no alternative cards. If there are multiple choices for cards to play, search is done to find the score. This mode is very fast but you don’t
77
77
.TP
78
78
.B mode=1
79
 
Always search to find the score. Even when the hand to play has only one card,  with possible equivalents, to play.  For both mode=0 and mode=1: If the preceding SolveBoard call had the same trump suit and the same or similar deal, except for deal.first, then the transposition table contents is reused from the preceding SolveBoard call. Setting mode=2 is no longer needed, but can still be done for backwards
80
 
compatibility.
 
79
Always search to find the score. Even when the hand to play has only one card,  with possible equivalents, to play.  For both mode=0 and mode=1: If the preceding SolveBoard call had the same trump suit and the same or similar deal, except for deal.first, then the transposition table contents is reused from the preceding SolveBoard call. Setting mode=2 is no longer needed in this case, but can still be done for backwards compatibility.
81
80
.TP
82
81
.B mode=2
83
 
As for mode=1, but the transposition table contents is reused from the preceding SolveBoard call. Deal must be the same, except for deal.first. Trump suit must be the same. Example:
84
 
 1st call:  SolveBoard(deal, -1, 1, 1, &fut),  deal.first=1, i.e. East leads.
85
 
 2nd call:  SolveBoard(deal, -1, 1, 2, &fut),  deal.first=2, i.e. South leads.
86
 
 3rd call:  SolveBoard(deal, -1, 1, 2, &fut),  deal.first=3, i.e. West leads.
87
 
 4th call:  SolveBoard(deal, -1, 1, 2, &fut),  deal.first=0, i.e. North leads.
 
82
As for mode=1, but the transposition table contents is reused from the preceding SolveBoard call.  It is the responsibility of the programmer using the DLL to ensure that reusing the table is safe in the actual situation. Example: Deal is the same, except for deal.first. Trump suit is the same.
 
83
 1st call:  SolveBoard(deal, -1, 1, 1, &fut, 0),  deal.first=1, i.e. East leads.
 
84
 2nd call:  SolveBoard(deal, -1, 1, 2, &fut, 0),  deal.first=2, i.e. South leads.
 
85
 3rd call:  SolveBoard(deal, -1, 1, 2, &fut, 0),  deal.first=3, i.e. West leads.
 
86
 4th call:  SolveBoard(deal, -1, 1, 2, &fut, 0),  deal.first=0, i.e. North leads.
88
87
.PP
89
88
\fBstruct futureTricks {\fP /* The DLL provides the score (number of tricks) that can be won by the card to play defined by its suit and rank. Array of all alternative cards. */
90
89
  \fBint nodes;\fP         /* Number of searched nodes */