I'm trying to skip part of my loops by using continue; however, I am unsure where how much code each continue statement skips. My suspicion is that, in the below code, the continue statements effectively do nothing and put my code right before the return false statements. I have marked with big HEREs where I would instead like the continue statements to take the code. I am curious if anyone has ideas about how to rewrite this code to make it work properly. Sure, the shunned goto statement would always work, but is there a more legitimate method?
for (int n=0; n <= 8; n++)
{
if (Board [row][column] == Board [n][column])
{
if (n == row)
{
continue;
}
return false;
}
HERE
if (Board [row][column] == Board [row][n])
{
if (n == column)
{
continue;
}
return false;
}
HERE
}
return true;