mirror of
https://github.com/c-cube/sidekick.git
synced 2025-12-06 03:05:31 -05:00
fix sudoku solve
This commit is contained in:
parent
a99fbed159
commit
59306d2e01
1 changed files with 19 additions and 16 deletions
|
|
@ -149,25 +149,28 @@ end = struct
|
||||||
type Const.view += Cell_is of { x: int; y: int; value: Cell.t }
|
type Const.view += Cell_is of { x: int; y: int; value: Cell.t }
|
||||||
|
|
||||||
let ops =
|
let ops =
|
||||||
(module struct
|
let pp out = function
|
||||||
let pp out = function
|
| Cell_is { x; y; value } ->
|
||||||
| Cell_is { x; y; value } ->
|
Fmt.fprintf out "(%d:%d=%a)" x y Cell.pp value
|
||||||
Fmt.fprintf out "(%d:%d=%a)" x y Cell.pp value
|
| _ -> ()
|
||||||
| _ -> ()
|
in
|
||||||
|
|
||||||
let hash = function
|
let hash = function
|
||||||
| Cell_is { x; y; value } ->
|
| Cell_is { x; y; value } ->
|
||||||
Hash.(combine3 (int x) (int y) (Cell.hash value))
|
Hash.(combine3 (int x) (int y) (Cell.hash value))
|
||||||
| _ -> assert false
|
| _ -> assert false
|
||||||
|
in
|
||||||
|
|
||||||
let equal a b =
|
let equal a b =
|
||||||
match a, b with
|
match a, b with
|
||||||
| Cell_is a, Cell_is b ->
|
| Cell_is a, Cell_is b ->
|
||||||
a.x = b.x && a.y = b.y && Cell.equal a.value b.value
|
a.x = b.x && a.y = b.y && Cell.equal a.value b.value
|
||||||
| _ -> false
|
| _ -> false
|
||||||
|
in
|
||||||
|
|
||||||
let opaque_to_cc _ = false
|
(* we don't use [ser] *)
|
||||||
end : Const.DYN_OPS)
|
let ser _ _ = assert false in
|
||||||
|
{ Const.Ops.pp; equal; hash; ser }
|
||||||
|
|
||||||
module Sat = Sidekick_sat
|
module Sat = Sidekick_sat
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue