Created
March 8, 2016 14:50
-
-
Save u6f6o/aeeec66e3783beefe0ba to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (defn- nice-neighbours | |
| [board idx] | |
| (let [mines (:mines board) | |
| explored (:explored board) | |
| neighbours (neighbours board idx) | |
| is-set? (fn [[k v]] (pos? v))] | |
| (when | |
| (not-any? is-set? (select-keys mines neighbours)) | |
| (->> (select-keys explored neighbours) | |
| (remove is-set?) | |
| (keys) | |
| (into #{}))))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment