Skip to content

Commit

Permalink
WHEW.
Browse files Browse the repository at this point in the history
  • Loading branch information
Niilyx committed Apr 4, 2022
1 parent 1b019f4 commit 49425a3
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions sudoku.html
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,10 @@

def new_game(ev):
global sudoku
global solution

#reset la solution
solution = []

difficulty = document["time"].value
nb_cases_a_suppr = 0
Expand Down Expand Up @@ -385,22 +389,23 @@
where.innerText = ""

def help(ev):

print(solution)
if window.won:
return
if not window.aide:
return

#Ne jamais compter sur le while True
i = 0
while i<99:
while i<999:
x = randint(0,sudoku.size - 1)
y = randint(0,sudoku.size - 1)

idToSeek = str(x) + ":" + str(y)
idToSeek = str(y) + ":" + str(x)
if document[idToSeek].innerText == "":
sudoku.grid[x][y].value = solution[x][y]
document[idToSeek].innerText = str(solution[x][y])
print(x,y,idToSeek)
sudoku.grid[y][x].value = solution[y][x]
document[idToSeek].innerText = str(solution[y][x])
break

i += 1
Expand Down

0 comments on commit 49425a3

Please sign in to comment.