I just had some questions on the code I'm working on now
1. will it work? I'm not finished yet but its very long already.
2. is there any way to make it less long?
any other suggestion are fine.
here's the section I'm interested in, for some reason the indentation doesn't show...
if (emptyBoard==true)
{row = 2;
col = 2;}
else if (emptyBoard==false)
forceWin = blockLoseForceWin(Board, compSymbol, row, col); //will this work?
else if (forceWin == false)
blockLose = blockLoseForceWin(Board, playerSymbol, row, col);
else if (blockLose==false)
if (weGoFirst == false)
{
if (nextMove == 0)
{
if (Board[2][2] == ' ')
{
row = 2;
col = 2;
}
else
{
row = 1;
col = 1;
}
nextMove++;
}
if (nextMove == 1)
}
if (weGoFirst == true)
{
if(Board[2][1] != ' ' || Board[3][2] != ' ' || Board[1][2] != ' ' || Board[2][3] != ' ')
if (nextMove == 0)
{
{if(Board[2][1] != ' ' || Board[3][2] != ' ')
{row = 1;
col = 1;}
else if(Board[1][2] != ' ' || Board[2][3] != ' ')
{row = 1;
col = 3;}
nextMove++;
}
}
{if (nextMove == 1)
{
row = 1;
col = 1;
}
nextMove++;}
{if (nextMove == 3)
{
if (Board[2][1] != playerSymbol && Board[2][2] != playerSymbol && Board[2][3] != playerSymbol)
{row = 2;
col = 1;}
else
{row = 3;
col = 1;}
}
}
else if(Board[2][1] != ' ' || Board[3][2] != ' ' || Board[1][2] != ' ' || Board[2][3] != ' ')
//check diagonals
}