i\'m trying to write a Sudoku solver which will return only the first possible solution. i managed to print all possible solutions with void methods but i can\'t stop on the
Change
if(board1.boardIsOk()) // check if the board is legal return nextCell(line, column); // continue
into
if(board1.boardIsOk()) { // check if the board is legal boolean solved = nextCell(line, column); // continue if (solved) { return true; ] } ... return false;