From 6ae9244fa656af2681fd4b006fae5ff805465f79 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maximilian=20Ke=C3=9Fler?= Date: Fri, 11 Aug 2023 17:05:52 +0200 Subject: [PATCH] print best actions in current state --- main.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/main.cpp b/main.cpp index d7de691..e04d574 100644 --- a/main.cpp +++ b/main.cpp @@ -23,6 +23,16 @@ namespace Hanabi { std::cout << "Probability with optimal play: " << res << std::endl; std::cout << "Enumerated " << game->enumerated_states() << " states" << std::endl; std::cout << "Visited " << game->position_tablebase().size() << " unique game states. " << std::endl; + for (const auto &[action, probability] : game->get_reasonable_actions()) { + std::cout << action; + if(probability.has_value()) { + std::cout << " " << probability.value(); + } else { + std::cout << " unknown"; + } + std::cout << ", "; + } + std::cout << std::endl; unsigned long biggest_key = 0; for(const auto& [key, prob] : game->position_tablebase()) { biggest_key = std::max(biggest_key, key); @@ -107,7 +117,7 @@ void check_games(unsigned num_players, unsigned max_draw_pile_size, unsigned fir int main(int argc, char *argv[]) { #ifndef NDEBUG - test(); +// test(); #endif if(argc == 3) { std::string game(argv[1]);