bd_rules.c

filter: Statementstmt 0.0% 0 / 156 Branchbran 0.0% 0 / 138 Conditioncond n/a MC/DCmcdc n/a Subroutinesub n/a Podpod n/a totaltotal 0.0% 0 / 294 CC 0 SCAR 0
CC
0
Cov
0%
CRAP 0
« bd_moves.c ↑ Summary bd_search.c »
1 /* bd_rules.c - a game: a board, the moves that made it, and how it ends.
2 *
3 * PERL-FREE, as the other bd_*.c files are.
4 *
5 * THE RULES THIS FILE IMPLEMENTS, quoted from the source the distribution
6 * names in its documentation:
7 *
8 * 11. "The king wins the game on reaching any of the marked corner squares.
9 * The attackers win if they capture the king."
10 * 12. "The game is drawn if a position is repeated, if a player cannot move,
11 * or if the players otherwise agree it."
12 *
13 * and three decisions where that text is silent or would give a result nobody
14 * means:
15 *
16 * - "REPEATED" IS THE THIRD TIME, with the same side to move, as draughts
17 * and chess count it. bd_variant.repeat says which occurrence; the literal
18 * reading of the sentence is 2.
19 * - ATTACKERS WITH NO PIECE LEFT HAVE LOST. Read literally rule 12 draws
20 * that game, because a side with nothing "cannot move". The sentence is
21 * for a side that is blocked.
22 * - A GAME THAT WILL NOT END IS DRAWN AT A PLY CAP. The attackers can seal
23 * all four corners, and then nothing above ends the game.
24 *
25 * Agreement and resignation are not here. They are something two people do,
26 * and the caller records them.
27 *
28 * THE ORDER THE ENDINGS ARE ASKED IN IS PART OF THE RULE, because one move can
29 * satisfy two of them:
30 *
31 * 1. the win the move itself made: the king home, or the king taken
32 * 2. the attackers have no piece
33 * 3. the side to move has no legal move
34 * 4. the position has occurred for the Nth time
35 * 5. the ply cap
36 *
37 * So a king who reaches a corner on the move that also repeats a position has
38 * won, and taking the last attacker is a win and not a blocked side.
39 */
40  
41 #include <stdlib.h>
42 #include <string.h>
43 #include "bd_abi.h"
44  
45 0 static const struct bd_abi *E(void) { return bd_abi_table(); }
46  
47 /* ---- the game ------------------------------------------------------------------
48 *
49 * Everything about a ply is kept by its index: the key of the position after
50 * it, the outcome as it stood then, whether the move that made it captured,
51 * and the undo that takes it back. Index 0 is the starting position and has no
52 * move behind it.
53 *
54 * THE ARRAYS HOLD ply_cap + 1 ENTRIES AND CANNOT OVERFLOW: at the cap the
55 * outcome is a draw and game_do refuses, so the index never passes it.
56 */
57  
58 struct bd_game {
59 struct bd_board *board;
60 struct bd_variant variant;
61 int cap; /* the ply cap, as clamped */
62 int ply; /* moves made so far */
63 unsigned long long *key; /* [0 .. cap] */
64 int *outcome; /* [0 .. cap] */
65 unsigned char *captured; /* [0 .. cap], 1 if that move captured */
66 struct bd_undo *undo; /* [1 .. cap], undo[i] takes ply i back */
67 };
68  
69 static int GAMES_LIVE = 0;
70  
71 /* A rule set as a game will use it. A cap of nothing or less means the
72 * default, and so does a cap above what the arrays are allowed to be; a
73 * repeat below 2 would draw every game at its first position, and means 2. */
74 0 static void variant_clamped(struct bd_variant *out, const struct bd_variant *v)
75 {
76 0 ▶ if (v) *out = *v;
Branch: 1 branch
BranchTrueFalseTotal
if (v) *out = *v; 0 0 0
77 0 else (E())->variant_default(out);
78 0 ▶ if (out->ply_cap <= 0 || out->ply_cap > BD_PLY_CAP_MAX) out->ply_cap = BD_PLY_CAP_DEFAULT;
Branch: 2 branches
BranchTrueFalseTotal
if (out->ply_cap <= 0 || out->ply_cap > BD_PLY_CAP_MAX) out->ply_cap = BD_PLY_CAP_DEFAULT; 0 0 0
if (out->ply_cap <= 0 || out->ply_cap > BD_PLY_CAP_MAX) out->ply_cap = BD_PLY_CAP_DEFAULT; 0 0 0
79 0 ▶ if (out->repeat < 2) out->repeat = 2;
Branch: 1 branch
BranchTrueFalseTotal
if (out->repeat < 2) out->repeat = 2; 0 0 0
80 0 }
81  
82 /* ---- repetition -----------------------------------------------------------------
83 *
84 * How many times the current position has occurred, this time included.
85 *
86 * THE WALK STOPS AT THE LAST CAPTURE. Pieces only ever leave the board, so a
87 * position from before a capture has more pieces on it than any after and
88 * cannot be the one on the board now. Stopping there changes no answer; it
89 * only means a long game does not search its whole length on every move.
90 *
91 * A KEY MATCH IS TRUSTED. Two different positions sharing a 64-bit key would
92 * be a draw called in error, and nothing here guards against it.
93 */
94 0 static int bd_repeats(const struct bd_game *g)
95 {
96 unsigned long long now;
97 0 int i, n = 0;
98 0 ▶ if (!g) return 0;
Branch: 1 branch
BranchTrueFalseTotal
if (!g) return 0; 0 0 0
99 0 now = g->key[g->ply];
100 0 ▶ for (i = g->ply; i >= 0; i--) {
Branch: 1 branch
BranchTrueFalseTotal
for (i = g->ply; i >= 0; i--) { 0 0 0
101 0 ▶ if (g->key[i] == now) n++;
Branch: 1 branch
BranchTrueFalseTotal
if (g->key[i] == now) n++; 0 0 0
102 0 ▶ if (g->captured[i]) break;
Branch: 1 branch
BranchTrueFalseTotal
if (g->captured[i]) break; 0 0 0
103 }
104 0 return n;
105 }
106  
107 /* ---- the outcome ------------------------------------------------------------------ */
108  
109 0 static int king_home_somewhere(const struct bd_game *g)
110 {
111 int f, r;
112 0 ▶ for (r = 0; r < BD_SIZE; r++) {
Branch: 1 branch
BranchTrueFalseTotal
for (r = 0; r < BD_SIZE; r++) { 0 0 0
113 0 ▶ for (f = 0; f < BD_SIZE; f++) {
Branch: 1 branch
BranchTrueFalseTotal
for (f = 0; f < BD_SIZE; f++) { 0 0 0
114 0 int sq = (E())->square_of(f, r);
115 0 ▶ int edge = f == 0 || r == 0 || f == BD_SIZE - 1 || r == BD_SIZE - 1;
Branch: 4 branches
BranchTrueFalseTotal
int edge = f == 0 || r == 0 || f == BD_SIZE - 1 || r == BD_SIZE - 1; 0 0 0
int edge = f == 0 || r == 0 || f == BD_SIZE - 1 || r == BD_SIZE - 1; 0 0 0
int edge = f == 0 || r == 0 || f == BD_SIZE - 1 || r == BD_SIZE - 1; 0 0 0
int edge = f == 0 || r == 0 || f == BD_SIZE - 1 || r == BD_SIZE - 1; 0 0 0
116 0 ▶ if ((E())->at(g->board, sq) != BD_KING) continue;
Branch: 1 branch
BranchTrueFalseTotal
if ((E())->at(g->board, sq) != BD_KING) continue; 0 0 0
117 0 ▶ if ((E())->is_corner(sq) || (g->variant.escape_edge && edge)) return 1;
Branch: 3 branches
BranchTrueFalseTotal
if ((E())->is_corner(sq) || (g->variant.escape_edge && edge)) return 1; 0 0 0
if ((E())->is_corner(sq) || (g->variant.escape_edge && edge)) return 1; 0 0 0
if ((E())->is_corner(sq) || (g->variant.escape_edge && edge)) return 1; 0 0 0
118 }
119 }
120 0 return 0;
121 }
122  
123 /* endings 2 to 5: the ones that are read off the position and its history and
124 * not off the move that was just made */
125 0 static int judge_rest(const struct bd_game *g)
126 {
127 0 ▶ if ((E())->count(g->board, BD_ATTACKER) == 0) return BD_BY_NO_PIECES;
Branch: 1 branch
BranchTrueFalseTotal
if ((E())->count(g->board, BD_ATTACKER) == 0) return BD_BY_NO_PIECES; 0 0 0
128 0 ▶ if ((E())->gen_moves(g->board, &g->variant, NULL, 0) == 0) return BD_DRAW_NO_MOVE;
Branch: 1 branch
BranchTrueFalseTotal
if ((E())->gen_moves(g->board, &g->variant, NULL, 0) == 0) return BD_DRAW_NO_MOVE; 0 0 0
129 0 ▶ if (bd_repeats(g) >= g->variant.repeat) return BD_DRAW_REPETITION;
Branch: 1 branch
BranchTrueFalseTotal
if (bd_repeats(g) >= g->variant.repeat) return BD_DRAW_REPETITION; 0 0 0
130 0 ▶ if (g->ply >= g->cap) return BD_DRAW_PLY_CAP;
Branch: 1 branch
BranchTrueFalseTotal
if (g->ply >= g->cap) return BD_DRAW_PLY_CAP; 0 0 0
131 0 return BD_ONGOING;
132 }
133  
134 /* A position nobody moved into, so there is no move to read a win from. No
135 * king on the board: he has been captured. A king standing where he wins: he
136 * has won. Otherwise it is judged like any other. */
137 0 static int judge_start(const struct bd_game *g)
138 {
139 0 ▶ if ((E())->count(g->board, BD_KING) == 0) return BD_BY_CAPTURE;
Branch: 1 branch
BranchTrueFalseTotal
if ((E())->count(g->board, BD_KING) == 0) return BD_BY_CAPTURE; 0 0 0
140 0 ▶ if (king_home_somewhere(g)) return BD_BY_CORNER;
Branch: 1 branch
BranchTrueFalseTotal
if (king_home_somewhere(g)) return BD_BY_CORNER; 0 0 0
141 0 return judge_rest(g);
142 }
143  
144 0 static int judge_move(const struct bd_game *g, int flags)
145 {
146 0 ▶ if (flags & BD_KING_HOME) return BD_BY_CORNER;
Branch: 1 branch
BranchTrueFalseTotal
if (flags & BD_KING_HOME) return BD_BY_CORNER; 0 0 0
147 0 ▶ if (flags & BD_KING_TAKEN) return BD_BY_CAPTURE;
Branch: 1 branch
BranchTrueFalseTotal
if (flags & BD_KING_TAKEN) return BD_BY_CAPTURE; 0 0 0
148 0 return judge_rest(g);
149 }
150  
151 /* ---- lifecycle -------------------------------------------------------------------- */
152  
153 0 static void bd_game_drop(struct bd_game *g)
154 {
155 0 ▶ if (!g) return;
Branch: 1 branch
BranchTrueFalseTotal
if (!g) return; 0 0 0
156 0 ▶ if (g->board) (E())->board_drop(g->board);
Branch: 1 branch
BranchTrueFalseTotal
if (g->board) (E())->board_drop(g->board); 0 0 0
157 0 free(g->key);
158 0 free(g->outcome);
159 0 free(g->captured);
160 0 free(g->undo);
161 0 free(g);
162 0 GAMES_LIVE--;
163 }
164  
165 0 static struct bd_game *game_alloc(const struct bd_variant *v)
166 {
167 0 struct bd_game *g = (struct bd_game *) calloc(1, sizeof(struct bd_game));
168 size_t slots;
169 0 ▶ if (!g) return NULL;
Branch: 1 branch
BranchTrueFalseTotal
if (!g) return NULL; 0 0 0
170 0 GAMES_LIVE++;
171 0 variant_clamped(&g->variant, v);
172 0 g->cap = g->variant.ply_cap;
173 0 slots = (size_t) g->cap + 1;
174 0 g->key = (unsigned long long *) calloc(slots, sizeof(unsigned long long));
175 0 g->outcome = (int *) calloc(slots, sizeof(int));
176 0 g->captured = (unsigned char *) calloc(slots, 1);
177 0 g->undo = (struct bd_undo *) calloc(slots, sizeof(struct bd_undo));
178 0 ▶ if (!g->key || !g->outcome || !g->captured || !g->undo) {
Branch: 4 branches
BranchTrueFalseTotal
if (!g->key || !g->outcome || !g->captured || !g->undo) { 0 0 0
if (!g->key || !g->outcome || !g->captured || !g->undo) { 0 0 0
if (!g->key || !g->outcome || !g->captured || !g->undo) { 0 0 0
if (!g->key || !g->outcome || !g->captured || !g->undo) { 0 0 0
179 0 bd_game_drop(g);
180 0 return NULL;
181 }
182 0 return g;
183 }
184  
185 /* A game from a copy of `b`, or from the set-up when `b` is NULL. The board
186 * handed in is left alone and may be dropped at once. */
187 0 static struct bd_game *bd_game_new(const struct bd_board *b, const struct bd_variant *v)
188 {
189 0 struct bd_game *g = game_alloc(v);
190 0 ▶ if (!g) return NULL;
Branch: 1 branch
BranchTrueFalseTotal
if (!g) return NULL; 0 0 0
191 0 ▶ g->board = b ? (E())->board_copy(b) : (E())->board_new();
Branch: 1 branch
BranchTrueFalseTotal
g->board = b ? (E())->board_copy(b) : (E())->board_new(); 0 0 0
192 0 ▶ if (!g->board) { bd_game_drop(g); return NULL; }
Branch: 1 branch
BranchTrueFalseTotal
if (!g->board) { bd_game_drop(g); return NULL; } 0 0 0
193 0 g->ply = 0;
194 0 g->key[0] = (E())->key(g->board);
195 0 g->captured[0] = 0;
196 0 g->outcome[0] = judge_start(g);
197 0 return g;
198 }
199  
200 0 static struct bd_game *bd_game_copy(const struct bd_game *src)
201 {
202 struct bd_game *g;
203 size_t slots;
204 0 ▶ if (!src) return NULL;
Branch: 1 branch
BranchTrueFalseTotal
if (!src) return NULL; 0 0 0
205 0 g = game_alloc(&src->variant);
206 0 ▶ if (!g) return NULL;
Branch: 1 branch
BranchTrueFalseTotal
if (!g) return NULL; 0 0 0
207 0 g->board = (E())->board_copy(src->board);
208 0 ▶ if (!g->board) { bd_game_drop(g); return NULL; }
Branch: 1 branch
BranchTrueFalseTotal
if (!g->board) { bd_game_drop(g); return NULL; } 0 0 0
209 0 slots = (size_t) src->cap + 1;
210 0 g->ply = src->ply;
211 0 memcpy(g->key, src->key, slots * sizeof(unsigned long long));
212 0 memcpy(g->outcome, src->outcome, slots * sizeof(int));
213 0 memcpy(g->captured, src->captured, slots);
214 0 memcpy(g->undo, src->undo, slots * sizeof(struct bd_undo));
215 0 return g;
216 }
217  
218 0 static int bd_games_live(void) { return GAMES_LIVE; }
219  
220 /* ---- reading a game --------------------------------------------------------------- */
221  
222 0 ▶static const struct bd_board *bd_game_board(const struct bd_game *g) { return g ? g->board : NULL; }
Branch: 1 branch
BranchTrueFalseTotal
static const struct bd_board *bd_game_board(const struct bd_game *g) { return g ? g->board : NULL; } 0 0 0
223 0 ▶static int bd_game_ply(const struct bd_game *g) { return g ? g->ply : 0; }
Branch: 1 branch
BranchTrueFalseTotal
static int bd_game_ply(const struct bd_game *g) { return g ? g->ply : 0; } 0 0 0
224 0 ▶static int bd_game_cap(const struct bd_game *g) { return g ? g->cap : 0; }
Branch: 1 branch
BranchTrueFalseTotal
static int bd_game_cap(const struct bd_game *g) { return g ? g->cap : 0; } 0 0 0
225 0 ▶static int bd_game_outcome(const struct bd_game *g) { return g ? g->outcome[g->ply] : BD_ONGOING; }
Branch: 1 branch
BranchTrueFalseTotal
static int bd_game_outcome(const struct bd_game *g) { return g ? g->outcome[g->ply] : BD_ONGOING; } 0 0 0
226  
227 0 static void bd_game_variant(const struct bd_game *g, struct bd_variant *out)
228 {
229 0 ▶ if (g && out) *out = g->variant;
Branch: 2 branches
BranchTrueFalseTotal
if (g && out) *out = g->variant; 0 0 0
if (g && out) *out = g->variant; 0 0 0
230 0 }
231  
232 0 static int bd_winner_of(int outcome)
233 {
234 0 ▶ if (outcome == BD_BY_CAPTURE) return BD_ATTACKERS;
Branch: 1 branch
BranchTrueFalseTotal
if (outcome == BD_BY_CAPTURE) return BD_ATTACKERS; 0 0 0
235 0 ▶ if (outcome == BD_BY_CORNER || outcome == BD_BY_NO_PIECES) return BD_DEFENDERS;
Branch: 2 branches
BranchTrueFalseTotal
if (outcome == BD_BY_CORNER || outcome == BD_BY_NO_PIECES) return BD_DEFENDERS; 0 0 0
if (outcome == BD_BY_CORNER || outcome == BD_BY_NO_PIECES) return BD_DEFENDERS; 0 0 0
236 0 return -1;
237 }
238  
239 0 static int bd_game_winner(const struct bd_game *g) { return bd_winner_of(bd_game_outcome(g)); }
240  
241 /* The key of the position after `ply` moves, or 0 for a ply the game has not
242 * reached. */
243 0 static unsigned long long bd_game_key_at(const struct bd_game *g, int ply)
244 {
245 0 ▶ if (!g || ply < 0 || ply > g->ply) return 0;
Branch: 3 branches
BranchTrueFalseTotal
if (!g || ply < 0 || ply > g->ply) return 0; 0 0 0
if (!g || ply < 0 || ply > g->ply) return 0; 0 0 0
if (!g || ply < 0 || ply > g->ply) return 0; 0 0 0
246 0 return g->key[ply];
247 }
248  
249 /* The moves of the side to move, and NONE once the game is over: a finished
250 * game has no legal move, whatever the pieces could do. */
251 0 static int bd_game_moves(const struct bd_game *g, int *out, int max)
252 {
253 0 ▶ if (!g || g->outcome[g->ply] != BD_ONGOING) return 0;
Branch: 2 branches
BranchTrueFalseTotal
if (!g || g->outcome[g->ply] != BD_ONGOING) return 0; 0 0 0
if (!g || g->outcome[g->ply] != BD_ONGOING) return 0; 0 0 0
254 0 return (E())->gen_moves(g->board, &g->variant, out, max);
255 }
256  
257 /* ---- playing ----------------------------------------------------------------------
258 *
259 * game_do IS A RULES CALL, the first in this distribution that refuses. A
260 * move in a finished game is BD_PLAY_OVER; a move the side to move may not
261 * make is BD_PLAY_ILLEGAL; and in both cases the game is exactly as it was.
262 */
263 0 static int bd_game_do(struct bd_game *g, int mv, int *flags_out)
264 {
265 int flags, at;
266 0 ▶ if (flags_out) *flags_out = 0;
Branch: 1 branch
BranchTrueFalseTotal
if (flags_out) *flags_out = 0; 0 0 0
267 0 ▶ if (!g) return BD_PLAY_ILLEGAL;
Branch: 1 branch
BranchTrueFalseTotal
if (!g) return BD_PLAY_ILLEGAL; 0 0 0
268 0 ▶ if (g->outcome[g->ply] != BD_ONGOING) return BD_PLAY_OVER;
Branch: 1 branch
BranchTrueFalseTotal
if (g->outcome[g->ply] != BD_ONGOING) return BD_PLAY_OVER; 0 0 0
269 0 ▶ if (!(E())->is_legal(g->board, &g->variant, mv)) return BD_PLAY_ILLEGAL;
Branch: 1 branch
BranchTrueFalseTotal
if (!(E())->is_legal(g->board, &g->variant, mv)) return BD_PLAY_ILLEGAL; 0 0 0
270  
271 0 at = g->ply + 1;
272 0 flags = (E())->do_move(g->board, &g->variant, mv, &g->undo[at]);
273 0 g->ply = at;
274 0 g->key[at] = (E())->key(g->board);
275 0 g->captured[at] = (flags & BD_DID_CAPTURE) ? 1 : 0;
276 0 g->outcome[at] = judge_move(g, flags);
277  
278 0 ▶ if (flags_out) *flags_out = flags;
Branch: 1 branch
BranchTrueFalseTotal
if (flags_out) *flags_out = flags; 0 0 0
279 0 return BD_PLAY_OK;
280 }
281  
282 /* game_do with two questions left out, for a search: see the header. The
283 * outcome is judged in the same order with "no move" skipped, and a position
284 * that is both blocked and something else is a draw either way. */
285 0 static void bd_game_push(struct bd_game *g, int mv, int *flags_out)
286 {
287 int flags, at, outcome;
288 0 ▶ if (flags_out) *flags_out = 0;
Branch: 1 branch
BranchTrueFalseTotal
if (flags_out) *flags_out = 0; 0 0 0
289 0 ▶ if (!g || g->ply >= g->cap) return;
Branch: 2 branches
BranchTrueFalseTotal
if (!g || g->ply >= g->cap) return; 0 0 0
if (!g || g->ply >= g->cap) return; 0 0 0
290  
291 0 at = g->ply + 1;
292 0 flags = (E())->do_move(g->board, &g->variant, mv, &g->undo[at]);
293 0 g->ply = at;
294 0 g->key[at] = (E())->key(g->board);
295 0 g->captured[at] = (flags & BD_DID_CAPTURE) ? 1 : 0;
296  
297 0 ▶ if (flags & BD_KING_HOME) outcome = BD_BY_CORNER;
Branch: 1 branch
BranchTrueFalseTotal
if (flags & BD_KING_HOME) outcome = BD_BY_CORNER; 0 0 0
298 0 ▶ else if (flags & BD_KING_TAKEN) outcome = BD_BY_CAPTURE;
Branch: 1 branch
BranchTrueFalseTotal
else if (flags & BD_KING_TAKEN) outcome = BD_BY_CAPTURE; 0 0 0
299 0 ▶ else if ((E())->count(g->board, BD_ATTACKER) == 0) outcome = BD_BY_NO_PIECES;
Branch: 1 branch
BranchTrueFalseTotal
else if ((E())->count(g->board, BD_ATTACKER) == 0) outcome = BD_BY_NO_PIECES; 0 0 0
300 0 ▶ else if (bd_repeats(g) >= g->variant.repeat) outcome = BD_DRAW_REPETITION;
Branch: 1 branch
BranchTrueFalseTotal
else if (bd_repeats(g) >= g->variant.repeat) outcome = BD_DRAW_REPETITION; 0 0 0
301 0 ▶ else if (g->ply >= g->cap) outcome = BD_DRAW_PLY_CAP;
Branch: 1 branch
BranchTrueFalseTotal
else if (g->ply >= g->cap) outcome = BD_DRAW_PLY_CAP; 0 0 0
302 0 else outcome = BD_ONGOING;
303 0 g->outcome[at] = outcome;
304  
305 0 ▶ if (flags_out) *flags_out = flags;
Branch: 1 branch
BranchTrueFalseTotal
if (flags_out) *flags_out = flags; 0 0 0
306 }
307  
308 /* Takes the last move back. Everything kept for that ply is simply left
309 * behind: the index steps down and the entries above it are dead until a new
310 * move writes over them. Returns 0 when there is no move to take back. */
311 0 static int bd_game_undo(struct bd_game *g)
312 {
313 0 ▶ if (!g || g->ply == 0) return 0;
Branch: 2 branches
BranchTrueFalseTotal
if (!g || g->ply == 0) return 0; 0 0 0
if (!g || g->ply == 0) return 0; 0 0 0
314 0 (E())->undo_move(g->board, &g->undo[g->ply]);
315 0 g->ply--;
316 0 return 1;
317 }
318  
319 /* ---- installed into the table by bd_engine.c ------------------------------------- */
320  
321 void bd_rules_install(struct bd_abi *t);
322  
323 0 void bd_rules_install(struct bd_abi *t)
324 {
325 0 t->game_new = bd_game_new;
326 0 t->game_copy = bd_game_copy;
327 0 t->game_drop = bd_game_drop;
328 0 t->games_live = bd_games_live;
329  
330 0 t->game_board = bd_game_board;
331 0 t->game_variant = bd_game_variant;
332 0 t->game_ply = bd_game_ply;
333 0 t->game_cap = bd_game_cap;
334 0 t->game_outcome = bd_game_outcome;
335 0 t->game_winner = bd_game_winner;
336 0 t->winner_of = bd_winner_of;
337 0 t->game_key_at = bd_game_key_at;
338 0 t->game_moves = bd_game_moves;
339 0 t->repeats = bd_repeats;
340  
341 0 t->game_do = bd_game_do;
342 0 t->game_undo = bd_game_undo;
343 0 t->game_push = bd_game_push;
344 0 }
« bd_moves.c ↑ Summary bd_search.c »