I would like to stop only the nested for
loop, not the do while
loop, in the following code. I have tried all the possible positions of break without success.
do
{
draw(d);
printf("tile to move\n");
int tile = GetInt();
for(int i = 0; i < d; i++)
{
for (int j = 0; j < d; ++j)
{
if(tile == board[i][j])
{
if(board[i+1][j] == 0)
{
int f = tile;
board[i][j] = 0;
board[i+1][j] = f;
}
}
}
}
}
while(true);