solverl v0.1.5 Sudoku

Example: Sudoku solver.

Sudoku puzzle is a string with elements of the puzzle in row-major order, where a blank entry is represented by "."

Link to this section Summary

Functions

Solve asynchronously using Sudoku.AsyncHandler as a solution handler.

 # Solve synchronously.
 # Example (prints all solutions):

 Enum.each(Sudoku.solve_sync(
    "8..6..9.5.............2.31...7318.6.24.....73...........279.1..5...8..36..3......"),
    fn ({:solution, sol}) -> Logger.info Sudoku.print_grid(sol["puzzle"])
       (_) -> :ok
    end)

Link to this section Functions

Link to this function

solve(puzzle, args \\ [])

Solve asynchronously using Sudoku.AsyncHandler as a solution handler.

Link to this function

solve_sync(puzzle)

 # Solve synchronously.
 # Example (prints all solutions):

 Enum.each(Sudoku.solve_sync(
    "8..6..9.5.............2.31...7318.6.24.....73...........279.1..5...8..36..3......"),
    fn ({:solution, sol}) -> Logger.info Sudoku.print_grid(sol["puzzle"])
       (_) -> :ok
    end)