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

Function main

examples/solve_board_pbn.cpp:21–90  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

19
20
21auto main() -> int
22{
23 DealPBN dlPBN;
24 FutureTricks fut2, // solutions == 2
25 fut3; // solutions == 3
26
27 int target;
28 int solutions;
29 int mode;
30 int res;
31 char line[80];
32 bool match2,
33 match3;
34
35#if defined(__linux) || defined(__APPLE__)
36 SetMaxThreads(0);
37#endif
38
39 for (int handno = 0; handno < 3; handno++)
40 {
41 dlPBN.trump = trump_suit_[handno];
42 dlPBN.first = first_hand_[handno];
43
44 dlPBN.currentTrickSuit[0] = 0;
45 dlPBN.currentTrickSuit[1] = 0;
46 dlPBN.currentTrickSuit[2] = 0;
47
48 dlPBN.currentTrickRank[0] = 0;
49 dlPBN.currentTrickRank[1] = 0;
50 dlPBN.currentTrickRank[2] = 0;
51
52 strcpy(dlPBN.remainCards, pbn_hands_[handno]);
53
54 target = -1;
55 solutions = 3;
56 mode = 0;
57 res = SolveBoardPBN(dlPBN, target, solutions, mode, &fut3, 0);
58
59 if (res != RETURN_NO_FAULT)
60 {
61 ErrorMessage(res, line);
62 printf("DDS error: %s\n", line);
63 }
64
65 match3 = compare_future_tricks(&fut3, handno, solutions);
66
67 solutions = 2;
68 res = SolveBoardPBN(dlPBN, target, solutions, mode, &fut2, 0);
69 if (res != RETURN_NO_FAULT)
70 {
71 ErrorMessage(res, line);
72 printf("DDS error: %s\n", line);
73 }
74
75 match2 = compare_future_tricks(&fut2, handno, solutions);
76
77 sprintf(line,
78 "SolveBoardPBN, hand %d: solutions 3 %s, solutions 2 %s\n",

Callers

nothing calls this directly

Calls 6

SetMaxThreadsFunction · 0.85
SolveBoardPBNFunction · 0.85
ErrorMessageFunction · 0.85
compare_future_tricksFunction · 0.85
print_pbn_handFunction · 0.85
print_future_tricksFunction · 0.85

Tested by

no test coverage detected