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

Function DumpInput

library/src/dump.cpp:269–317  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

267
268
269int DumpInput(
270 const int errCode,
271 const Deal& dl,
272 const int target,
273 const int solutions,
274 const int mode)
275{
276#ifndef DDS_NO_DUMP_ON_ERROR
277 std::ofstream fout;
278 fout.open("dump.txt");
279
280 fout << "Error code=" << errCode << "\n\n";
281 fout << "Deal data:\n";
282 fout << "trump=";
283
284 if (dl.trump == DDS_NOTRUMP)
285 fout << "N\n";
286 else
287 fout << card_suit[dl.trump] << "\n";
288 fout << "first=" << card_hand[dl.first] << "\n";
289
290 unsigned short ranks[4][4];
291
292 for (int k = 0; k <= 2; k++)
293 if (dl.currentTrickRank[k] != 0)
294 {
295 fout << "index=" << k <<
296 " currentTrickSuit=" << card_suit[dl.currentTrickSuit[k]] <<
297 " currentTrickRank= " << card_rank[dl.currentTrickRank[k]] << "\n";
298 }
299
300 for (int h = 0; h < DDS_HANDS; h++)
301 for (int s = 0; s < DDS_SUITS; s++)
302 {
303 fout << "index1=" << h << " index2=" << s <<
304 " remainCards=" << dl.remainCards[h][s] << "\n";
305 ranks[h][s] = static_cast<unsigned short>
306 (dl.remainCards[h][s] >> 2);
307 }
308
309 fout << "\ntarget=" << target << "\n";
310 fout << "solutions=" << solutions << "\n";
311 fout << "mode=" << mode << "\n\n\n";
312 fout << PrintDeal(ranks, 8);
313
314 fout.close();
315#endif
316 return 0;
317}
318
319
320void DumpTopLevel(

Callers 2

board_range_checksFunction · 0.85
board_value_checksFunction · 0.85

Calls 1

PrintDealFunction · 0.85

Tested by

no test coverage detected