What i want to do is use a for-loop to find the first empty cell in a 2D array and put a value in it. However, my code applies the loop to all empty cells in the array. What am i doing wrong here? I hope for a quick reply.
for (int row = 0; row < GRIDSIZE; row++) { for (int col = 0; col < GRIDSIZE; col++) { if (isEmpty(row, col) == false) { printIt(); } else { setCell(row, col, 1);
Any help would be appreciated.