Sudoku game using Python:
This program is a basic implementation of a Sudoku solver. The program takes a 2D list as input, representing the Sudoku board, The program then uses a backtracking algorithm to solve the Sudoku puzzle. The
solve()
function attempts to fill in the empty spaces on the board with numbers from 1 to 9, while ensuring that each row, column, and 3x3 box contains unique numbers. The valid()
function is used to check if a given number is a valid placement on the board, while the find_empty()
function is used to find the next empty space on the board. Finally, the print_board()
function is used to display the board in a readable format.You can run this script in any software that support python, such as IDLE, Anaconda, Jupyter Notebook, etc.
No comments:
Post a Comment