From 5b6e877a51618a972053254c13e4938812c0eea4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maximilian=20Ke=C3=9Fler?= Date: Tue, 9 Jan 2024 01:10:27 +0100 Subject: [PATCH] add debug macro --- include/game_state.hpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/include/game_state.hpp b/include/game_state.hpp index 872d308..f0ae6ee 100644 --- a/include/game_state.hpp +++ b/include/game_state.hpp @@ -1163,6 +1163,22 @@ namespace Hanabi unsigned long id, Hanabi::probability_t probability ) { + // This macro can be activated if we want to dump details on all game states visited for analysis purposes. +#ifdef DUMP_STATES + std::cout << *this << std::endl; + const auto [id_parts, cards] = dump_unique_id_parts(); + std::cout << "id is: " << id << ", id parts are: "; + for (auto const & part: id_parts) { + std::cout << part << " "; + } + std::cout << ", encoded cards are "; + for (auto const & part: cards) { + std::cout << part << " "; + } + std::cout << ", probability is "; + print_probability(std::cout, probability); + std::cout << "\n" << std::endl; +#endif if (_position_tablebase.contains(id)) { ASSERT(_position_tablebase[id] == probability);