There may be many issues with your code... you sure posted a lot of it. Because you are asking your question it is incumbent on you to try everything you can on your own first and then reduce your question to the smallest amount of code necessary to clarify what is going on. As it is, I don't feel that you've put much effort into asking this question.
But maybe I can still provide some help:
void board::getBestMove() {
board returnBoard;
miniMax(INT_MIN + 1, INT_MAX -1, returnBoard);
*this = returnBoard;
}
See how you are saying *this = returnBoard
.
That must mean that you want to get a board back from miniMax
.
But look at how miniMax
is defined!
int board::miniMax(int alpha, int beta, board childWithMaximum)
It accepts childWithMaximum
via pass by value so it cannot return a board in this way.
what you wanted to say was probably:
int board::miniMax(int alpha, int beta, board & childWithMaximum)