1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
/*
DDS, a bridge double dummy solver.
Copyright (C) 2006-2014 by Bo Haglund /
2014-2018 by Bo Haglund & Soren Hein.
See LICENSE and README.
*/
// System headers
// Project headers
/* "hand" is leading hand, "relative" is hand relative leading
hand.
The handId macro implementation follows a solution
by Thomas Andrews.
All hand identities are given as
0=NORTH, 1=EAST, 2=SOUTH, 3=WEST. */
/**
* @brief Calculate relative hand position.
* @param hand Base hand position (0=NORTH, 1=EAST, 2=SOUTH, 3=WEST)
* @param relative Relative offset (0-3)
* @return Resulting hand position (0-3)
*/
/**
* @brief Represents a single card move in the game.
*
* Contains information about a card that can be played, including
* its suit, rank, sequence status, and sorting weight.
*/
;
/**
* @brief Collection of moves available at a single ply.
*
* Stores all possible moves at a given point in the game,
* along with tracking of current and last move indices.
*/
;
/**
* @brief Identifies a high card by rank and holding hand.
*
* Used to track high cards in each suit during analysis.
*/
;
/**
* @brief Complete position state during game analysis.
*
* Represents the full state of a bridge position including card distribution,
* trump information, and current play state. This is the core data structure
* used throughout the solver.
*/
;
/**
* @brief Trick-level data for current play state.
*
* Tracks information about the current trick being played,
* including play counts, best cards, and lead information.
*/
;
/**
* @brief Evaluation result for a position.
*
* Contains the number of tricks that can be won and which specific
* card ranks can win in each suit.
*/
;
/**
* @brief Simple card representation.
*
* Basic structure identifying a card by suit and rank.
*/
;
/**
* @brief Extended card representation with sequence information.
*
* Like Card but includes sequence information for tracking
* equivalent cards during move generation.
*/
;
/**
* @brief Absolute rank with holding hand.
*
* Compact representation (2 bytes) identifying a card rank
* and which hand holds it.
*/
;
/**
* @brief Relative rank table for all suits.
*
* Contains absolute rank information for all possible card positions
* across all suits. Used for quick lookup during position analysis.
*/
;
/**
* @brief Parameters for batch board solving.
*
* Contains input/output structures for solving multiple boards
* in a single operation.
*/
;
/**
* @brief Execution mode for solver operations.
*
* Determines how the solver processes a position - solving for best play,
* calculating all possible outcomes, or tracing a specific line of play.
*/
enum class ;