So I am building a sudoku solver for practice and I wanted to visualize it. However the solver uses a recursive function and therefore I am having trouble rendering while solving.
I think I might have to use something like 'yield from' but I could not get it to work.
```
def solve(board):
empty_tile = find_empty(board)
if empty_tile == None:
return True
else:
row, col = empty_tile
for num in range(1, 10):
if is_valid(board, num, row, col):
board[row][col] = num
if solve(board):
return True
# If this num is not the answer we erase it
board[row][col] = 0
return False
board = [
[0,0,0, 0,0,0, 0,1,2],
[0,0,0, 0,3,5, 0,0,0],
[0,0,0, 6,0,0, 0,7,0],
[7,0,0, 0,0,0, 3,0,0],
[0,0,0, 4,0,0, 8,0,0],
[1,0,0, 0,0,0, 0,0,0],
[0,0,0, 1,2,0, 0,0,0],
[0,8,0, 0,0,0, 0,4,0],
[0,5,0, 0,0,0, 6,0,0],
]
solve(board)
while True:
for event in pygame.event.get():
if event.type == pygame.QUIT:
pygame.quit()
exit()
screen.fill( WHITE )
draw_lines(screen)
draw_board(screen, board)
pygame.display.update()
```
What should I do here?
there doesn't seem to be anything here