Skip to content
Permalink
Browse files
Restored code to normal after testing impMoveWin
Reset access modifiers and runGame function
  • Loading branch information
hortonr6 committed Aug 11, 2019
1 parent 682b534 commit 3ceee313441b4aca5e35876f71f56998035066d5
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 40 deletions.
3 AI.h
@@ -22,12 +22,11 @@ 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,31 +10,13 @@ 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)
@@ -47,10 +47,10 @@
<string>
<iostream>

1565482083 source:e:\richard\programming projects\c++\tic-tac-toe\ai.cpp
1565546187 source:e:\richard\programming projects\c++\tic-tac-toe\ai.cpp
"AI.h"

1565525911 e:\richard\programming projects\c++\tic-tac-toe\ai.h
1565546404 e:\richard\programming projects\c++\tic-tac-toe\ai.h
<iostream>
<stdlib.h>
<time.h>
@@ -77,6 +77,6 @@
1565481586 source:e:\richard\programming projects\c++\tic-tac-toe\player.cpp
"Player.h"

1565481560 source:e:\richard\programming projects\c++\tic-tac-toe\game.cpp
1565546175 source:e:\richard\programming projects\c++\tic-tac-toe\game.cpp
"Game.h"

@@ -2,49 +2,49 @@
<CodeBlocks_layout_file>
<FileVersion major="1" minor="0" />
<ActiveTarget name="Debug" />
<File name="Game.cpp" open="1" top="0" tabpos="3" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="4555" topLine="146" />
</Cursor>
</File>
<File name="Grid.cpp" open="1" top="0" tabpos="5" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="59" topLine="24" />
<Cursor1 position="2667" topLine="0" />
</Cursor>
</File>
<File name="main.cpp" open="1" top="0" tabpos="1" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="6480" topLine="318" />
</Cursor>
</File>
<File name="AI.h" open="1" top="0" tabpos="8" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<File name="Game.cpp" open="1" top="0" tabpos="3" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="110" topLine="0" />
<Cursor1 position="4555" topLine="146" />
</Cursor>
</File>
<File name="Grid.h" open="1" top="0" tabpos="4" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<File name="Game.h" open="1" top="0" tabpos="2" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="241" topLine="0" />
<Cursor1 position="662" topLine="1" />
</Cursor>
</File>
<File name="Game.h" open="1" top="0" tabpos="2" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<File name="Grid.h" open="1" top="0" tabpos="4" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="662" topLine="1" />
<Cursor1 position="283" topLine="0" />
</Cursor>
</File>
<File name="Player.h" open="1" top="0" tabpos="6" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<File name="AI.cpp" open="1" top="1" tabpos="9" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="368" topLine="0" />
<Cursor1 position="3299" topLine="97" />
</Cursor>
</File>
<File name="Player.cpp" open="1" top="1" tabpos="7" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<File name="Player.cpp" open="1" top="0" tabpos="7" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="465" topLine="93" />
</Cursor>
</File>
<File name="AI.cpp" open="1" top="0" tabpos="9" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<File name="Player.h" open="1" top="0" tabpos="6" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="368" topLine="0" />
</Cursor>
</File>
<File name="AI.h" open="1" top="0" tabpos="8" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="109" topLine="0" />
<Cursor1 position="897" topLine="8" />
</Cursor>
</File>
</CodeBlocks_layout_file>

0 comments on commit 3ceee31

Please sign in to comment.