i am trying to make a recursive function that will go through the numbers 1-9 and if one of them works will then go on to the next space in the array. something is going wrong so that when solve() calls itself, if it fails it does not continue with the for loop, but instead calls itself again.

Code:void solve() { if(finished) return; // iterate through the numbers, after hitting 9 return (go back a step) puzzle[x][y]++; for(;puzzle[x][y] <= 9;puzzle[x][y]++) { array_out(); if(test()) { x++; if(x < 9) { solve(); continue; } else { x = 0; y++; if(y<9) solve(); else finished = true; continue; } } } puzzle[x][y] = 0; return; }