diff --git a/library/src/ab_search.cpp b/library/src/ab_search.cpp index fbc4e8fd..762d75f0 100644 --- a/library/src/ab_search.cpp +++ b/library/src/ab_search.cpp @@ -225,7 +225,7 @@ static bool ab_search_0_ctx( { #ifdef DDS_AB_HITS DumpRetrieved(thrp->fileRetrieved.GetStream(), - * posPoint, cardsP, target, depth); + * posPoint, *cardsP, target, depth); #endif for (int ss = 0; ss < DDS_SUITS; ss++) diff --git a/library/src/dump.cpp b/library/src/dump.cpp index 860333ed..eb7419c7 100644 --- a/library/src/dump.cpp +++ b/library/src/dump.cpp @@ -15,6 +15,7 @@ #include "dump.hpp" #include #include +#include std::string PrintSuit(const unsigned short suitCode); @@ -335,3 +336,56 @@ void DumpTopLevel( ctx.search().trick_nodes() << " trick nodes\n\n"; } + +#ifdef DDS_AB_HITS + +void DumpRetrieved( + std::ofstream& fout, + const Pos& tpos, + const NodeCards& node, + const int target, + const int depth) +{ + fout << "Retrieved entry\n"; + fout << std::string(15, '-') << "\n"; + fout << PosToText(tpos, target, depth) << "\n"; + fout << FullNodeToText(node) << "\n"; + fout << RankToDiagrams(tpos.rank_in_suit, node) << "\n"; +} + + +void DumpStored( + std::ofstream& fout, + const Pos& tpos, + const Moves& moves, + const NodeCards& node, + const int target, + const int depth) +{ + fout << "Stored entry\n"; + fout << std::string(12, '-') << "\n"; + fout << PosToText(tpos, target, depth) << "\n"; + fout << NodeToText(node); + fout << moves.TrickToText((depth >> 2) + 1) << "\n"; + fout << PrintDeal(tpos.rank_in_suit, 16); +} + + +void DumpStored( + std::ofstream& fout, + const Pos& tpos, + SolverContext& ctx, + const NodeCards& node, + const int target, + const int depth) +{ + fout << "Stored entry\n"; + fout << std::string(12, '-') << "\n"; + fout << PosToText(tpos, target, depth) << "\n"; + fout << NodeToText(node); + fout << ctx.move_gen().trick_to_text((depth >> 2) + 1) << "\n"; + fout << PrintDeal(tpos.rank_in_suit, 16); +} + +#endif // DDS_AB_HITS +