Commit d5785595 authored by Maël RENAULT's avatar Maël RENAULT
Browse files

Update IHM_Sudoku.py

parent cd05d8bc
......@@ -98,10 +98,16 @@ class Grille_sudoku(QWidget):
item, ok = QInputDialog.getItem(self, "Choix du Chiffre",
"Chiffres", items, 0, False)
if ok and item:
ordi = Ordinateur()
ordi.solve(self.grille_utilise)
grille_solution = ordi.solution[0]
pos = list(locate(self.digitButtons, lambda x: x == clickedButton))
pos = pos[0]
self.grille_utilise[pos // 9, pos - 9 * (pos // 9)] = item
if grille_solution[pos % 9, pos//9] == int(item):
self.grille_utilise[pos % 9, pos // 9] = int(item)
clickedButton.setText(item)
else:
print("erreur")
def nouvelle_grille(self):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment