Add 4 random pop support with a probability of 10%

This commit is contained in:
manzerbredes 2015-05-03 01:29:19 +02:00
parent 870d354afd
commit 30f603ecd3

View file

@ -48,7 +48,17 @@ bool Game::isOver(){
void Game::popRandomNumber(){
std::tuple<int, int> coord(m_grid.getRandomEmptyCellCoord());
int number=2;
int percent=rand() % 100;
int number;
if(percent <= 10){
number=4;
}
else{
number=2;
}
m_grid.setCell(coord, number);
}