diff --git a/Board.cpp b/Board.cpp index 0571348..0cd08d1 100755 --- a/Board.cpp +++ b/Board.cpp @@ -479,6 +479,67 @@ void Board::displayPossibleMoves(vector input) cout<<"possible move: "< record; + + if (record.size() < 2) + { + cout<<"nothing to undo"<& inputVec, Board inputBoard) +{ + if (inputVec.size() == 10) + { + inputVec.erase(inputVec.begin()); + } + + else if (inputVec.size() > 10) + { + cout<<"QUEUE OVERFLOW!"< viewPossibleMoves(); string myToUpper(string input); void displayPossibleMoves(vector input); + void undo(Board& tablero); + void interpret(string input, Board& tablero); + void snapshot(vector& inputVec, Board inputBoard); void easyAI(); }; \ No newline at end of file diff --git a/main.cpp b/main.cpp index 6e8a8e0..37212b1 100644 --- a/main.cpp +++ b/main.cpp @@ -2,15 +2,26 @@ #include #include #include -#include "GameEngine.h" +#include "Board.h" using namespace std; int main() { + cout<<"\n----------------------------"<>choice; + + if (choice == 1) cout<<"playing with AI..."<>move; - b.move(move); + interpret(move,b); } vector possibleMoves = b.viewPossibleMoves(); //displayPossibleMoves(possibleMoves); for debugging purposes - AI + if (choice == 1) + { + b.easyAI(); + } + + else + { + while(b.getTurn() == 'X' ) + { + b.displayBoard(); + cout<<"\nEnter command: "; + cin>>move; + interpret(move,b); + } + } - b.easyAI(); - + //b.snapshot(); gameOver = b.isGameOver(); + + snapshot(record,b); } + //for debugging purposes + cout<<"Record:"<