summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/Model/Game.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/Model/Game.cpp b/src/Model/Game.cpp
index 1e24b11..aa3626c 100644
--- a/src/Model/Game.cpp
+++ b/src/Model/Game.cpp
@@ -15,11 +15,11 @@ void Game::play()
while(!m_grid->gridIsFull())
{
m_grid->show();
-
+
pop();
std::cout << std::endl;
}
-
+
m_grid->show();
}
@@ -32,23 +32,23 @@ void Game::showGrid()
void Game::pop()
{
bool cellChosen = false;
-
+
int i;
int j;
-
+
while(!cellChosen)
{
i = rand() % 4;
j = rand() % 4;
-
+
if (m_grid->isEmpty(i,j))
cellChosen = true;
}
-
+
m_grid->setCell(i, j, new Cell("2"));
}
bool Game::isOver()
{
return m_grid->gridIsFull();
-} \ No newline at end of file
+}