Browse Source

fixed the bug described in the first issue

master
VissaMoutafis 5 years ago
parent
commit
be153f01b9
  1. 1
      src/Controller.cpp
  2. 4
      src/Game.cpp

1
src/Controller.cpp

@ -1,6 +1,7 @@
#include "Controller.h" #include "Controller.h"
#include <assert.h> #include <assert.h>
#include <string> #include <string>
using namespace std; using namespace std;
Controller::Controller() Controller::Controller()

4
src/Game.cpp

@ -1,5 +1,6 @@
#include "Game.h" #include "Game.h"
#include <algorithm> #include <algorithm>
#include <limits.h>
using namespace std; using namespace std;
SnakeGame::SnakeGame() SnakeGame::SnakeGame()
@ -60,7 +61,8 @@ void SnakeGame::play(void){
play(playerName); //get the player to play the game play(playerName); //get the player to play the game
cin.clear();
cin.ignore(numeric_limits<streamsize>::max(), '\n');
cout << "Do you want to play again? (yes or no): "; cout << "Do you want to play again? (yes or no): ";
string ans; string ans;

Loading…
Cancel
Save