diff --git a/Grid.cpp b/Grid.cpp index 2ee0c2e..924e780 100644 --- a/Grid.cpp +++ b/Grid.cpp @@ -110,3 +110,13 @@ void Grid::resetGrid() grid[i] = blankGrid[i]; } } + +char Grid::viewSquare(int position) +{ + if(position >= 0 && position <= 8) + { + return this->grid[position]; + } + + return 'F'; +} diff --git a/Grid.h b/Grid.h index 48e027d..5b33f1e 100644 --- a/Grid.h +++ b/Grid.h @@ -12,6 +12,8 @@ class Grid void printGrid(); int checkChoice(char symbol, int input); + char viewSquare(int position); + private: const char blankGrid[9] = {'1', '2', '3', '4', '5', '6', '7', '8', '9'}; // Used to reset the main game grid char grid[9] = {'1', '2', '3', '4', '5', '6', '7', '8', '9'}; // Grid the game is played on and that is displayed to the user