Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion library/src/ab_search.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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++)
Expand Down
54 changes: 54 additions & 0 deletions library/src/dump.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#include "dump.hpp"
#include <solver_context/solver_context.hpp>
#include <trans_table/trans_table.hpp>
#include <utility/debug.h>


std::string PrintSuit(const unsigned short suitCode);
Expand Down Expand Up @@ -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

Loading