old_version/solver.py
def random_check(self) -> None:
        """
        At first function makes a deepcopy of sudoku array as an backup.
        Then it gets a blank cell with minimum number or permissible digits.
        Than gets one of the coordinates with that minimum.
        For chosen coordinates (blank cell) inserts randomly one of the available digits.
        After insertion function starts solving procedure again.
        If sudoku is not completed after solving procedure, original sudoku array is restored from backup.
        :return: None
        """
        backup_sudoku = deepcopy(self.s)
        minimum_number_of_digits = min(
            len(digits_list) for digits_list in self.s.possible_digits_in_cells.values() if len(digits_list) > 0)
        considered_position = choice([coordinate for coordinate in self.s.possible_digits_in_cells.keys()
                                      if len(self.s.possible_digits_in_cells[coordinate]) == minimum_number_of_digits])
        considered_digit = choice(self.s.possible_digits_in_cells[considered_position])
        self.insert_digit(considered_digit, considered_position[0], considered_position[1])
        self.check_stack_and_solve_again()
        if not self.is_sudoku_completed():
            self.s = backup_sudoku
        return None

        At first function makes a deepcopy of sudoku array as an backup.
        Then it gets a blank cell with minimum number or permissible digits.
        Than gets one of the coordinates with that minimum.
        For chosen coordinates (blank cell) inserts randomly one of the available digits.
        After insertion function starts solving procedure again.
        If sudoku is not completed after solving procedure, original sudoku array is restored from backup.
        :return: None
        
At first function makes a deepcopy of sudoku array as an backup.
Then it gets a blank cell with minimum number or permissible digits.
Than gets one of the coordinates with that minimum.
For chosen coordinates (blank cell) inserts randomly one of the available digits.
After insertion function starts solving procedure again.
If sudoku is not completed after solving procedure, original sudoku array is restored from backup.
At first function makes a deepcopy of sudoku array as an backup . Then it gets a blank cell with minimum number or permissible digits . Than gets one of the coordinates with that minimum . For chosen coordinates ( blank cell ) inserts randomly one of the available digits . After insertion function starts solving procedure again . If sudoku is not completed after solving procedure original sudoku array is restored from backup .
def random_check(self) -> None:
        backup_sudoku = deepcopy(self.s)
        minimum_number_of_digits = min(
            len(digits_list) for digits_list in self.s.possible_digits_in_cells.values() if len(digits_list) > 0)
        considered_position = choice([coordinate for coordinate in self.s.possible_digits_in_cells.keys()
                                      if len(self.s.possible_digits_in_cells[coordinate]) == minimum_number_of_digits])
        considered_digit = choice(self.s.possible_digits_in_cells[considered_position])
        self.insert_digit(considered_digit, considered_position[0], considered_position[1])
        self.check_stack_and_solve_again()
        if not self.is_sudoku_completed():
            self.s = backup_sudoku
        return None
def random_check ( self ) -> None : backup_sudoku = deepcopy ( self . s ) minimum_number_of_digits = min ( len ( digits_list ) for digits_list in self . s . possible_digits_in_cells . values ( ) if len ( digits_list ) > 0 ) considered_position = choice ( [ coordinate for coordinate in self . s . possible_digits_in_cells . keys ( ) if len ( self . s . possible_digits_in_cells [ coordinate ] ) == minimum_number_of_digits ] ) considered_digit = choice ( self . s . possible_digits_in_cells [ considered_position ] ) self . insert_digit ( considered_digit , considered_position [ 0 ] , considered_position [ 1 ] ) self . check_stack_and_solve_again ( ) if not self . is_sudoku_completed ( ) : self . s = backup_sudoku return None
At first function makes a deepcopy of sudoku array as an backup.
At first function makes a deepcopy of sudoku array as an backup .
"""
        At first function makes a deepcopy of sudoku array as an backup.
        Then it gets a blank cell with minimum number or permissible digits.
        Than gets one of the coordinates with that minimum.
        For chosen coordinates (blank cell) inserts randomly one of the available digits.
        After insertion function starts solving procedure again.
        If sudoku is not completed after solving procedure, original sudoku array is restored from backup.
        :return: None
        """
None
self