Improvements

Improved AI choice
This commit is contained in:
Valentino Orlandi 2022-10-19 23:24:06 +02:00
parent df1bcfd22f
commit c59d7e0066
Signed by: elB4RTO
GPG Key ID: 1719E976DB2D4E71
1 changed files with 3 additions and 1 deletions

View File

@ -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;