fixed board output
This commit is contained in:
parent
e06c7683fe
commit
9143c45d85
3 changed files with 13 additions and 23 deletions
14
Board.cpp
14
Board.cpp
|
@ -89,16 +89,16 @@ void Board::changeTurns()
|
|||
void Board::displayBoard()
|
||||
{
|
||||
cout<<"\n\n";
|
||||
cout<<" A B C D E F G H"<<endl;
|
||||
cout<<"; A B C D E F G H"<<endl;
|
||||
for (int i = 0; i < 8; ++i)
|
||||
{
|
||||
int mango = 8 - i;
|
||||
cout<<mango<<" ";
|
||||
cout<<"; "<<mango<<" ";
|
||||
for (int j = 0; j < 8; ++j)
|
||||
{
|
||||
cout<<boardArray[i][j]<<" ";
|
||||
cout<<"|"<<boardArray[i][j];
|
||||
}
|
||||
cout<<endl;
|
||||
cout<<"|\n";
|
||||
}
|
||||
cout<<'\n'<<endl;
|
||||
cout<<"turn : "<<turn;
|
||||
|
@ -123,7 +123,6 @@ int Board::charToIntColumn(char input) //converts column number to int
|
|||
return kolumn;
|
||||
}
|
||||
|
||||
|
||||
char Board::intToCharColumn(int input) //converts column number to int
|
||||
{
|
||||
char kolumn;
|
||||
|
@ -256,7 +255,6 @@ void Board::move(string inputMove)
|
|||
|
||||
}
|
||||
|
||||
|
||||
void Board::move(moves jugada)
|
||||
{
|
||||
|
||||
|
@ -408,9 +406,6 @@ bool Board::isThisMovePossible(int r, int c, string moveType)
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
vector<moves> Board::viewPossibleMoves()
|
||||
{
|
||||
vector<moves> output;
|
||||
|
@ -542,6 +537,7 @@ void Board::snapshot(vector<Board>& inputVec, Board inputBoard)
|
|||
inputVec.push_back(inputBoard);
|
||||
}
|
||||
|
||||
//move this to its own file
|
||||
void Board::easyAI()
|
||||
{
|
||||
|
||||
|
|
BIN
a.out
BIN
a.out
Binary file not shown.
18
test.cpp
18
test.cpp
|
@ -8,28 +8,22 @@ using namespace std;
|
|||
|
||||
int main()
|
||||
{
|
||||
cout<<"\n----------------------------"<<endl;
|
||||
cout<<"Welcome to Breakthrough\n"<<endl;
|
||||
cout<<"-----------------------------\n\n"<<endl;
|
||||
cout<<"WELCOME\n";
|
||||
|
||||
cout<<"1. Play agains AI?"<<endl;
|
||||
cout<<"2. Play against a human?"<<endl;
|
||||
cout<<"Enter choice: "<<endl;
|
||||
cout<<"1. Play against AI?\n";
|
||||
cout<<"2. Play against a human?\n";
|
||||
cout<<"CHANGE THIS TO PARSE THINGS\n";
|
||||
cout<<"Enter choice: \n";
|
||||
|
||||
int choice;
|
||||
cin >> choice;
|
||||
|
||||
if (choice == 1) cout<<"playing with AI..."<<endl;
|
||||
else cout<<"playing with human..."<<endl;
|
||||
cout << "OK" << endl;
|
||||
|
||||
Board b;
|
||||
|
||||
string move;
|
||||
|
||||
bool gameOver = false;
|
||||
|
||||
vector<Board> record;
|
||||
|
||||
b.snapshot(record,b);
|
||||
|
||||
while (gameOver != true)
|
||||
|
|
Reference in a new issue