Skip to content
Permalink
Browse files
Tested impMoveWin
Shuffled access modifiers and runGame function to test impMoveWin function, test was passed with only one bug requiring attention
  • Loading branch information
hortonr6 committed Aug 11, 2019
1 parent cb57cde commit 682b534b736751946719238308b0d56fae0da24b
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 1 deletion.
1 AI.cpp
@@ -52,6 +52,7 @@ void AI::normalAITurn()
void AI::impossibleAITurn()
{
// AI logic for impossible difficulty
impMoveWin();
}

char AI::getSymbol()
3 AI.h
@@ -22,11 +22,12 @@ class AI

void setTargetGrid(Grid *grid);

void impossibleAITurn();
private:
enum difficultyScale{Normal = 1, Impossible = 2};

void normalAITurn();
void impossibleAITurn();


// Moves for impossible difficulty AI to use
int impMoveWin();
@@ -10,13 +10,31 @@ void Game::runGame()
// Starts the game and handles overall flow of events
aiObj.setTargetGrid(gridPtr);
playerObj.setTargetGrid(gridPtr);

aiObj.setSymbol('O');

gridObj.printGrid();
std::cout << std::endl;

gridObj.checkChoice('X', 4);
gridObj.checkChoice('X', 7);

gridObj.printGrid();
std::cout << std::endl;

aiObj.impossibleAITurn();

gridObj.printGrid();

/*
gameIntro();
do
{
gameLoop();
}while(playAgain());
quitGame();
*/
}

bool Game::checkWin(char symbol)

0 comments on commit 682b534

Please sign in to comment.