diff --git a/.DS_Store b/.DS_Store index e2ed0431e23f2be9fabdcf0c7fa0dd473aaaf8bb..1f8f2ec8a449021314a7a61827f68234c0a82e4e 100644 Binary files a/.DS_Store and b/.DS_Store differ diff --git a/applicationQT2048/gamemanager.cpp b/applicationQT2048/gamemanager.cpp index ec545f9cdc875bcac7dfc59eb5b3c3123d7e4153..be6a6aaf828402e45102b0ba2744ae91badd4846 100644 --- a/applicationQT2048/gamemanager.cpp +++ b/applicationQT2048/gamemanager.cpp @@ -243,7 +243,12 @@ void GameManager::addRandomElement() { int col = emptyCells[randomIndex].second; // Placer un '2' dans cette case - grid[row][col] = 2; + int randValue = std::rand() % 100; + if (randValue < 75) { + grid[row][col] = 2; + } else { + grid[row][col] = 4; + }; } }