InPlace.Examples.Sudoku (inplace v0.7.1)

Copy Markdown

Sudoku puzzle. The instance of puzzle is a string of DxD length , where D is a dimension of Sudoku puzzle (would be 9 by default). The values 1 to 9 represent pre-filled cells (clues, givens etc...); any other values represent hidden cells.

Summary

Functions

solution is a list of integers representing the 'flattened' solved puzzle

solution is a "cover" (list of indices into options built off the Sudoku instance). Note: the options only represent "hidden" cells.

Functions

block_item(row, d)

cell_item(row, d)

check_solution(solution)

@spec check_solution([integer()]) :: boolean()

solution is a list of integers representing the 'flattened' solved puzzle

column_item(row, d)

row_item(row, d)

solution_to_sudoku(solution, instance, options, d)

solution is a "cover" (list of indices into options built off the Sudoku instance). Note: the options only represent "hidden" cells.

solve(instance, opts \\ [])

Solver