Hi,
So down to the point I want to create a loop that searches every part of the array and analyzing every white and black piece on the "board" [array].
Then the "AI" for the othello will choose the immediate best place to put down a white chip to get the maximum amount of chips flipped for white.
My issue is I cannot think of a way how the conditions should be set up for the loops and also how would I flip the pieces in between?
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
int bestMove(int & row, int &col, char color) // returns the max
resultOfMove(row,col)
{
int whiteCount = 0;
int bestSum = 0;
for (int i = 0; i < row; i++)
{
for (int j = 0; j < col; j++)
{
if (board[i][j] == color)
whiteCount++;
if (board[0, 1, 2, 3, 4, 5, 6, 7, 8][j] ==
color)
bestSum = bestSum + whiteCount;
}
// when a disk of color is placed at (row, col)
I know its incorrect but it gives you an idea of what I am trying to do.
Any help would be greatly appreciated.
Thanks!