sudokusolver.py
def solve(self) -> None:
        '''
        Backtracking method of solving sudoku.
        For consecutive empty cells method checks subsequent numbers (from 1 to 9).
        If number is permissible, program inserts number and moves to next empty cell.
        If number in impermissible, program checks next number.
        If all 9 numbers were already checked and none of them was permissible,
        program returns to the previous empty cell and tries next number.
        :return: None
        '''
        cell_index = 0
        while cell_index < len(self.empty_cells):
            coordinates = self.empty_cells[cell_index]
            row, column = coordinates
            number = self.test_numbers[coordinates]

            if number == 10:
                self.insert_number(row, column)
                self.test_numbers[coordinates] = 1
                cell_index -= 1
                continue

            if self.validate_number(row, column, number):
                self.insert_number(row, column, number)
                cell_index += 1
            self.test_numbers[coordinates] += 1

        return None

        Backtracking method of solving sudoku.
        For consecutive empty cells method checks subsequent numbers (from 1 to 9).
        If number is permissible, program inserts number and moves to next empty cell.
        If number in impermissible, program checks next number.
        If all 9 numbers were already checked and none of them was permissible,
        program returns to the previous empty cell and tries next number.
        :return: None
        
Backtracking method of solving sudoku.
For consecutive empty cells method checks subsequent numbers (from 1 to 9).
If number is permissible, program inserts number and moves to next empty cell.
If number in impermissible, program checks next number.
If all 9 numbers were already checked and none of them was permissible,
program returns to the previous empty cell and tries next number.
Backtracking method of solving sudoku . For consecutive empty cells method checks subsequent numbers ( from 1 to 9 ) . If number is permissible program inserts number and moves to next empty cell . If number in impermissible program checks next number . If all 9 numbers were already checked and none of them was permissible program returns to the previous empty cell and tries next number .
def solve(self) -> None:
        cell_index = 0
        while cell_index < len(self.empty_cells):
            coordinates = self.empty_cells[cell_index]
            row, column = coordinates
            number = self.test_numbers[coordinates]
            if number == 10:
                self.insert_number(row, column)
                self.test_numbers[coordinates] = 1
                cell_index -= 1
                continue
            if self.validate_number(row, column, number):
                self.insert_number(row, column, number)
                cell_index += 1
            self.test_numbers[coordinates] += 1
        return None
def solve ( self ) -> None : cell_index = 0 while cell_index < len ( self . empty_cells ) : coordinates = self . empty_cells [ cell_index ] row , column = coordinates number = self . test_numbers [ coordinates ] if number == 10 : self . insert_number ( row , column ) self . test_numbers [ coordinates ] = 1 cell_index -= 1 continue if self . validate_number ( row , column , number ) : self . insert_number ( row , column , number ) cell_index += 1 self . test_numbers [ coordinates ] += 1 return None
Backtracking method of solving sudoku.
Backtracking method of solving sudoku .
'''
        Backtracking method of solving sudoku.
        For consecutive empty cells method checks subsequent numbers (from 1 to 9).
        If number is permissible, program inserts number and moves to next empty cell.
        If number in impermissible, program checks next number.
        If all 9 numbers were already checked and none of them was permissible,
        program returns to the previous empty cell and tries next number.
        :return: None
        '''
None
self