Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Partial #430

Open
wants to merge 16 commits into
base: master
Choose a base branch
from
Prev Previous commit
Next Next commit
valid-values-for
  • Loading branch information
epicharri committed Jul 25, 2017
commit 6b0e68c7c662da572c77554b0744dd82fc091153
11 changes: 10 additions & 1 deletion src/sudoku.clj
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

(def board identity)

(def all-values #{1 2 3 4 5 6 7 8 9})

(defn value-at [board coord]
(get-in board coord))

Expand Down Expand Up @@ -44,7 +46,14 @@
(coord-pairs-in-block coord)))

(defn valid-values-for [board coord]
nil)
(if (has-value? board coord)
#{}
(set/difference
all-values
(set/union
(block-values board coord)
(row-values board coord)
(col-values board coord)))))

(defn filled? [board]
nil)
Expand Down