diff options
| author | manzerbredes <loic.guegan_secondary@yahoo.fr> | 2015-05-01 10:20:19 +0200 |
|---|---|---|
| committer | manzerbredes <loic.guegan_secondary@yahoo.fr> | 2015-05-01 10:20:19 +0200 |
| commit | 40e0b381c1bb5b8c8274f9149808c2929b16dfa2 (patch) | |
| tree | 409a0687120af01f7a9431e6901e02028c5ec1cd /src | |
| parent | 80c37e438ee57f0eceb322dbee778a49d9db0896 (diff) | |
Correct tab
Diffstat (limited to 'src')
| -rw-r--r-- | src/Model/Game.cpp | 46 |
1 files changed, 23 insertions, 23 deletions
diff --git a/src/Model/Game.cpp b/src/Model/Game.cpp index aa3626c..069a481 100644 --- a/src/Model/Game.cpp +++ b/src/Model/Game.cpp @@ -2,53 +2,53 @@ Game::Game() { - m_grid = new Grid(4); + m_grid = new Grid(4); } Game::~Game() { - delete m_grid; + delete m_grid; } void Game::play() { - while(!m_grid->gridIsFull()) - { - m_grid->show(); + while(!m_grid->gridIsFull()) + { + m_grid->show(); - pop(); - std::cout << std::endl; - } + pop(); + std::cout << std::endl; + } - m_grid->show(); + m_grid->show(); } void Game::showGrid() { - m_grid->show(); - std::cout << std::endl; + m_grid->show(); + std::cout << std::endl; } void Game::pop() { - bool cellChosen = false; + bool cellChosen = false; - int i; - int j; + int i; + int j; - while(!cellChosen) - { - i = rand() % 4; - j = rand() % 4; + while(!cellChosen) + { + i = rand() % 4; + j = rand() % 4; - if (m_grid->isEmpty(i,j)) - cellChosen = true; - } + if (m_grid->isEmpty(i,j)) + cellChosen = true; + } - m_grid->setCell(i, j, new Cell("2")); + m_grid->setCell(i, j, new Cell("2")); } bool Game::isOver() { - return m_grid->gridIsFull(); + return m_grid->gridIsFull(); } |
