board=[['.','6','1','.','3','.','.','2','.'],
['.','5','.','.','.','8','1','.','7'],
['.','.','.','.','.','7','.','3','4'],
['5','7','.','3','.','.','9','.','.'],
['1','9','.','7','.','.','.','.','.'],
['8','.','2','4','.','.','.','6','.'],
['.','4','.','.','1','.','2','5','.']]
def check_node_choices(self, board, x, y):
"""
检查节点所有可能性
"""
choices = ['1', '2', '3', '4', '5', '6', '7', '8', '9']
for one in board[x]:
if one in choices:
choices.remove(one)
for i in range(9):
if board[i][y] in choices:
choices.remove(board[i][y])
bx, by = (x // 3) * 3, (y // 3) * 3
for i in range(bx, bx + 3):
for j in range(by, by+3):
if board[i][j] in choices:
choices.remove(board[i][j])
return choices
for i in range(9):
for j in range(9):
if board[i][j] != '.':
continue
choices = self.check_node_choices(board, i, j)
if not choices:
pass
while choices:
board[i][j] = choices.pop()
self.solveSudoku(board)
if all('.' not in board[m] for m in range(i, 9)):
pass
board[i][j] = '.'
if not choices:
pass
pass 这个程序怎么改正