Skip to content
Snippets Groups Projects
Commit a236e345 authored by Delplanque Sara's avatar Delplanque Sara
Browse files

Génération de 2 ou de 4

parent b55b753e
No related branches found
No related tags found
No related merge requests found
No preview for this file type
......@@ -243,7 +243,12 @@ void GameManager::addRandomElement() {
int col = emptyCells[randomIndex].second;
// Placer un '2' dans cette case
int randValue = std::rand() % 100;
if (randValue < 75) {
grid[row][col] = 2;
} else {
grid[row][col] = 4;
};
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment