diff --git a/Board.cpp b/Board.cpp index 6f30d40..7dde616 100644 --- a/Board.cpp +++ b/Board.cpp @@ -80,7 +80,7 @@ void Board::isTaken(int r, int c) { for(int x = 0; x < opieces.size(); ++x) { if (opieces[x]->getX() == r && opieces[x]->getY() == c) { opieces.erase(opieces.begin() + x); - cout << "otaken set to TRUE\n"; + //cout << "otaken set to TRUE\n"; otaken = true; } } @@ -89,7 +89,7 @@ void Board::isTaken(int r, int c) { for(int x = 0; x < xpieces.size(); ++x) { if (xpieces[x]->getX() == r && xpieces[x]->getY() == c) { xpieces.erase(xpieces.begin() + x); - cout << "xtaken set to TRUE\n"; + //cout << "xtaken set to TRUE\n"; xtaken = true; } } @@ -582,16 +582,16 @@ int Board::evaluate(char max, char min){ val += 2 * (maxPieces.size() - minPieces.size()); - cout << (checkTaken(max)) << "\n"; - cout << (checkTaken(min)) << "\n"; + //cout << (checkTaken(max)) << "\n"; + //cout << (checkTaken(min)) << "\n"; //check for taken conditions if (checkTaken(min)){ - cout << "adding 10 to val\n"; + //cout << "adding 10 to val\n"; val += 10; } if (checkTaken(max)){ - cout << "subtracting 10 from val\n"; + //cout << "subtracting 10 from val\n"; val -= 10; } @@ -604,7 +604,7 @@ int Board::evaluate(char max, char min){ val = INT_MIN / 2; } - cout << "val: " << val << "\n"; + //cout << "val: " << val << "\n"; return val; } diff --git a/Engine.cpp b/Engine.cpp index a3024de..60b879c 100644 --- a/Engine.cpp +++ b/Engine.cpp @@ -101,7 +101,7 @@ void Engine::AI(int depth){ createMMTree(root, depth, 1); m = evaluateMMTree(root); - printTree(0, root); + //printTree(0, root); b->move(m); b->changeTurns(); @@ -125,12 +125,12 @@ void Engine::createMMTree(MNode* node, int depth, int alt){ max = current.getTurn(); current.changeTurns(); min = current.getTurn(); - + /* if (current.checkTaken('X')) cout << "xtaken true\n"; if (current.checkTaken('O')) cout << "otaken true\n"; - + */ temp = new MNode(current, listOfMoves[i], current.evaluate(max, min)); if (alt == 1) diff --git a/Engine.h b/Engine.h index fbcb212..ae314af 100644 --- a/Engine.h +++ b/Engine.h @@ -8,6 +8,7 @@ using namespace std; class Engine { Board* b; + public: Engine(); Board* getBoard() { return b; } diff --git a/test.cpp b/test.cpp index 8b1eb77..d4d7566 100644 --- a/test.cpp +++ b/test.cpp @@ -4,6 +4,7 @@ using namespace std; int main() { + Board b; Engine e; e.startGame(); }