From 4a8d8da46c6e7d1dd6077eae75e8f2e056687f97 Mon Sep 17 00:00:00 2001 From: Gunnar Beutner Date: Tue, 1 Jun 2021 00:06:16 +0200 Subject: Hearts: Make debugging AI suggestions easier When building Hearts with HEARTS_DEBUG we highlight the card the AI would have picked. This makes comparing AI and human decisions easier. --- Userland/Games/Hearts/Game.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'Userland/Games') diff --git a/Userland/Games/Hearts/Game.cpp b/Userland/Games/Hearts/Game.cpp index 8952ec2e3b..fd19ade0bc 100644 --- a/Userland/Games/Hearts/Game.cpp +++ b/Userland/Games/Hearts/Game.cpp @@ -397,6 +397,11 @@ void Game::let_player_play_card() if (player.is_human) { m_human_can_play = true; + if constexpr (HEARTS_DEBUG) { + auto card_index = pick_card(player); + auto& card = player.hand[card_index]; + card->set_inverted(true); + } update(); return; } -- cgit v1.2.3