deleted an unnecessary function
This commit is contained in:
parent
c9ab7c2622
commit
228a2ed77a
3 changed files with 7 additions and 8 deletions
13
Board.cpp
13
Board.cpp
|
@ -100,7 +100,7 @@ void Board::displayBoard()
|
||||||
cout<<"|\n";
|
cout<<"|\n";
|
||||||
}
|
}
|
||||||
cout<<'\n'<<endl;
|
cout<<'\n'<<endl;
|
||||||
cout<<"turn : "<<turn;
|
cout<<"turn : "<<turn << "\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
int Board::charToIntColumn(char input) //converts column number to int
|
int Board::charToIntColumn(char input) //converts column number to int
|
||||||
|
@ -143,17 +143,16 @@ char Board::intToCharColumn(int input) //converts column number to int
|
||||||
|
|
||||||
void Board::move(string inputMove)
|
void Board::move(string inputMove)
|
||||||
{
|
{
|
||||||
|
|
||||||
moves jugada = parse(inputMove);
|
moves jugada = parse(inputMove);
|
||||||
|
|
||||||
int row = 8 - (jugada.row);
|
int row = 8 - (jugada.row);
|
||||||
int kolumn = charToIntColumn(jugada.column);
|
int kolumn = charToIntColumn(jugada.column);
|
||||||
int temp = boardArray[row][kolumn];
|
int temp = boardArray[row][kolumn];
|
||||||
int reflector = 1;
|
int reflector = 1;
|
||||||
|
|
||||||
if (row > 8 || row < 0 || kolumn > 8 || kolumn < 0)
|
if (row > 8 || row < 0 || kolumn > 8 || kolumn < 0)
|
||||||
{
|
{
|
||||||
cout<<"ERROR: index out of bound!"<<endl;
|
cout<<"ERROR: index out of bound in move()!"<<endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (temp != turn)
|
else if (temp != turn)
|
||||||
|
@ -262,7 +261,7 @@ void Board::move(moves jugada)
|
||||||
|
|
||||||
if (row > 8 || row < 0 || kolumn > 8 || kolumn < 0)
|
if (row > 8 || row < 0 || kolumn > 8 || kolumn < 0)
|
||||||
{
|
{
|
||||||
cout<<"ERROR: index out of bound!"<<endl;
|
cout<<"ERROR: index out of bound in second move()!"<<endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
int temp = boardArray[row][kolumn];
|
int temp = boardArray[row][kolumn];
|
||||||
|
@ -536,8 +535,8 @@ void Board::easyAI()
|
||||||
vector<moves> listOfMoves = viewPossibleMoves();
|
vector<moves> listOfMoves = viewPossibleMoves();
|
||||||
|
|
||||||
//obvious moves
|
//obvious moves
|
||||||
if (){
|
if (false){
|
||||||
//
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
//random
|
//random
|
||||||
|
|
BIN
a.out
BIN
a.out
Binary file not shown.
2
test.cpp
2
test.cpp
|
@ -12,7 +12,7 @@ int main()
|
||||||
|
|
||||||
cout<<"1. Play against AI?\n";
|
cout<<"1. Play against AI?\n";
|
||||||
cout<<"2. Play against a human?\n";
|
cout<<"2. Play against a human?\n";
|
||||||
cout<<"CHANGE THIS TO PARSE THINGS\n";
|
//cout<<"CHANGE THIS TO PARSE THINGS\n";
|
||||||
cout<<"Enter choice: \n";
|
cout<<"Enter choice: \n";
|
||||||
|
|
||||||
int choice;
|
int choice;
|
||||||
|
|
Reference in a new issue