Sudoku: Difference between revisions
Content added Content deleted
m (→Immutable Backtracker: formatting) |
|||
Line 4,032: | Line 4,032: | ||
| _ -> "No solution or Parse Failure" |
| _ -> "No solution or Parse Failure" |
||
/// Is digit allowed in the square in question? !!! hot path !!!! |
/// Is digit allowed in the square in question? !!! hot path !!!! |
||
/// Array/Array2D no faster and they need explicit copy since not immutable |
|||
let constraints (values:Map<_,_>) s d = |
let constraints (values:Map<_,_>) s d = peers[s] |> Seq.map (fun p -> values[p]) |> Seq.exists ((=) d) |> not |
||
/// Move to next square or None if out of bounds |
/// Move to next square or None if out of bounds |