From c59d7e00669d186321d9e11700497d70158940fe Mon Sep 17 00:00:00 2001 From: Valentino Orlandi Date: Wed, 19 Oct 2022 23:24:06 +0200 Subject: [PATCH] Improvements Improved AI choice --- logdoctor/games/crisscross.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/logdoctor/games/crisscross.cpp b/logdoctor/games/crisscross.cpp index 028182ea..2f18d19b 100644 --- a/logdoctor/games/crisscross.cpp +++ b/logdoctor/games/crisscross.cpp @@ -302,7 +302,9 @@ void CrissCross::AI_updateWeights() } } // set the new weight for the empty tiles - const unsigned int new_weight = (win_streak>lose_streak) ? win_streak+1 : lose_streak+1; + const unsigned int new_weight = (win_streak>=lose_streak) + ? (win_streak==2) ? win_streak+2 : win_streak+1 + : lose_streak+1; for ( const auto& index : empty_tiles ) { if ( new_weight > this->board_weights[ index ] ) { this->board_weights[ index ] = new_weight;