MCPcopy Create free account
hub / github.com/dds-bridge/dds / loop_play

Function loop_play

library/tests/loop.cpp:239–304  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

237
238
239bool loop_play(
240 BoardsPBN * bop,
241 PlayTracesPBN * playsp,
242 SolvedPlays * solvedplp,
243 DealPBN * deal_list,
244 PlayTracePBN * play_list,
245 SolvedPlay * trace_list,
246 const int number,
247 const int stepsize)
248{
249#ifdef BATCHTIMES
250 cout << setw(8) << left << "Hand no." <<
251 setw(25) << right << "Time" << "\n";
252#endif
253
254 for (int i = 0; i < number; i += stepsize)
255 {
256 int count = (i + stepsize > number ? number - i : stepsize);
257
258 bop->no_of_boards = count;
259 playsp->no_of_boards = count;
260
261 for (int j = 0; j < count; j++)
262 {
263 bop->deals[j] = deal_list[i + j];
264 bop->target[j] = 0;
265 bop->solutions[j] = 3;
266 bop->mode[j] = 1;
267
268 playsp->plays[j] = play_list[i + j];
269 }
270
271 timer.start(count);
272 int ret;
273 if ((ret = AnalyseAllPlaysPBN(bop, playsp, solvedplp, 1))
274 != RETURN_NO_FAULT)
275 {
276 printf("loop_play i %i: Return %d\n", i, ret);
277 cout << "loop_play: i " << i << ": " << "return " << ret << "\n";
278 exit(0);
279 }
280 timer.end();
281
282#ifdef BATCHTIMES
283 timer.print_running(i+count, number);
284#endif
285
286 for (int j = 0; j < count; j++)
287 {
288 if (compare_TRACE(solvedplp->solved[j], trace_list[i+j]))
289 continue;
290
291 printf("loop_play i %d, j %d: Difference\n", i, j);
292 cout << "loop_play: i " << i << ", j " << j << ": " <<
293 "Difference\n\n";
294 print_double_TRACE(solvedplp->solved[j], trace_list[i+j]);
295 cout << "\n";
296 }

Callers 1

real_mainFunction · 0.85

Calls 6

AnalyseAllPlaysPBNFunction · 0.85
compare_TRACEFunction · 0.85
print_double_TRACEFunction · 0.85
startMethod · 0.80
endMethod · 0.80
print_runningMethod · 0.80

Tested by

no test coverage detected