Skip to content

Instantly share code, notes, and snippets.

Created December 12, 2012 15:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/4268803 to your computer and use it in GitHub Desktop.
Save anonymous/4268803 to your computer and use it in GitHub Desktop.
Get 3x3 (sub)squares from a sudoku board
(defn get-squares [cells]
(let [p (partition 3 cells)
q (for [x [0 1 2]] (drop x p))]
r (map #(take-nth 3 %) q)
(partition 9 (flatten r))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment