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

Function main

examples/solve_all_boards.cpp:21–75  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 6

SetMaxThreadsFunction · 0.85
SolveAllBoardsFunction · 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