A recursive Sudoku solver written as a PowerShell module.
Install from the PowerShell Gallery!
Install-Module -Name PS-Sudoku
There is now an option to play Sudoku! Enter PlaySudoku
after the module is installed.
The function can provide a hint, or solve the puzzle given its current state.
# First, generate a sudoku board, specify difficulty of "Easy, Medium, Hard, Expert, Insane, or UniqueSolution"
$SudokuBoard = GenerateGrid -Difficulty "Medium"
# Print the board to see the starting state
PrintGrid -SudokuGrid $SudokuBoard
# Solve the sudoku board. Note that depending on the difficulty of the puzzle, it may take a while. (The unique solution took 3.5 hrs on a 10th gen intel i5 processor)
SolveSudoku -SudokuGrid $SudokuBoard #add the -WatchAlgorithm switch to see the algorithm in action
# After the solver is complete, print the finished Sudoku board!
PrintGrid -SudokuGrid $SudokuBoard
CI System | Environment | Job Name & Status |
---|---|---|
GitHub Actions | Windows(v2019 - Current) | |
GitHub Actions | Ubuntu(v18 - Current) | |
GitHub Actions | MacOS(v10 - Current) |
CI System | Environment | Job Name & Status |
---|---|---|
GitHub Actions | Windows(v2019 - Current) | |
GitHub Actions | Ubuntu(v18 - Current) | |
GitHub Actions | MacOS(v10 - Current) |