diff --git a/usermods/TetrisAI_v2/rating.h b/usermods/TetrisAI_v2/rating.h index 4504ff468..88320818e 100644 --- a/usermods/TetrisAI_v2/rating.h +++ b/usermods/TetrisAI_v2/rating.h @@ -32,7 +32,7 @@ public: uint8_t fullLines; uint16_t bumpiness; uint16_t aggregatedHeight; - double score; + float score; uint8_t width; std::vector lineHights; @@ -57,7 +57,7 @@ public: this->fullLines = 0; this->bumpiness = 0; this->aggregatedHeight = 0; - this->score = -DBL_MAX; + this->score = -FLT_MAX; } }; diff --git a/usermods/TetrisAI_v2/readme.md b/usermods/TetrisAI_v2/readme.md index b21bc5fde..62b2da1c8 100644 --- a/usermods/TetrisAI_v2/readme.md +++ b/usermods/TetrisAI_v2/readme.md @@ -10,7 +10,7 @@ Just activate the usermod with `-D USERMOD_TETRISAI` and the effect will become ## Usage -It is best to set the background color to black, the border color to light grey and the game over color (foreground) to dark grey. +It is best to set the background color to black 🖤, the border color to light grey 🤍, the game over color (foreground) to dark grey 🩶, and color palette to 'Rainbow' 🌈. ### Sliders and boxes diff --git a/usermods/TetrisAI_v2/tetrisai.h b/usermods/TetrisAI_v2/tetrisai.h index 690489f82..ba4fe60e4 100644 --- a/usermods/TetrisAI_v2/tetrisai.h +++ b/usermods/TetrisAI_v2/tetrisai.h @@ -107,7 +107,7 @@ public: rating->score = (aHeight * (rating->aggregatedHeight)) + (fullLines * (rating->fullLines)) + (holes * (rating->holes)) + (bumpiness * (rating->bumpiness)); } - TetrisAI(): TetrisAI(-0.510066, 0.760666, -0.35663, -0.184483) + TetrisAI(): TetrisAI(-0.510066f, 0.760666f, -0.35663f, -0.184483f) {} TetrisAI(float aHeight, float fullLines, float holes, float bumpiness): @@ -178,9 +178,9 @@ public: if(findWorstMove) { //init rating for worst - if(bestRating->score == -DBL_MAX) + if(bestRating->score == -FLT_MAX) { - bestRating->score = DBL_MAX; + bestRating->score = FLT_MAX; } // update if we found a worse one diff --git a/usermods/TetrisAI_v2/usermod_v2_tetrisai.h b/usermods/TetrisAI_v2/usermod_v2_tetrisai.h index 6c5a3737c..587fa9a36 100644 --- a/usermods/TetrisAI_v2/usermod_v2_tetrisai.h +++ b/usermods/TetrisAI_v2/usermod_v2_tetrisai.h @@ -155,7 +155,7 @@ uint16_t mode_2DTetrisAI() if (tetrisai_data->intelligence != SEGMENT.custom1) { tetrisai_data->intelligence = SEGMENT.custom1; - float dui = 0.2 - (0.2 * (tetrisai_data->intelligence / 255.0)); + float dui = 0.2f - (0.2f * (tetrisai_data->intelligence / 255.0f)); tetrisai_data->tetris.ai.aHeight = -0.510066f + dui; tetrisai_data->tetris.ai.fullLines = 0.760666f - dui;