Ejemplo n.º 1
0
 def tipp_bttn_func(self):
     self.label.setText("")
     su = Sudoku(self.translate_to_2d())
     if not su.is_solved():
         not_defined = su.get_not_defined()
         solution = su.solve()
         x, y = random.choice(not_defined)
         self.elements[y][x].setText(str(solution[y][x]))
         self.elements[y][x].setStyleSheet("background-color:lightgreen")
Ejemplo n.º 2
0
 def validate_bttn_func(self):
     self.label.setText("")
     su = Sudoku(self.translate_to_2d())
     if su.is_solved():
         if su.validate():
             self.label.setText("Correct :) - There may be other solutions")
             return
     if su.validate():
         self.label.setText("So far so good, probably")
         return
     else:
         self.label.setText("Wrong :(")