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
| (ns sudoku-solver.core | |
| (:use [clojure.repl] | |
| [clojure.set :as set] | |
| [clojure.pprint])) | |
| (def example-board | |
| [[0 0 3 0 2 0 6 0 0] | |
| [9 0 0 3 0 5 0 0 1] | |
| [0 0 1 8 0 6 4 0 0] | |
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
| (ns Sudoko-Solver.core | |
| (:use [clojure.repl :as repl] | |
| [clojure.set :as set] | |
| [clojure.pprint])) | |
| (defn check-coll [coll] | |
| (= (set coll) | |
| #{1 2 3 4 5 6 7 8 9})) | |
| (defn not-zero? [num] |
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
| #lang racket | |
| (require racket/class | |
| racket/gui/base) | |
| ;; Utility function, Did my best to explain what it does and how it does it in the comments | |
| ;; Do not touch this until you have constructed an meaningful interpretive dance explaining | |
| ;; tail recursion and functional hash sets | |
| (define (count-freqs lst) | |
| ;; Given a list, returns an alist containing each distinct element paired with the number of occurances | |
| (let counter ([hash-count (hash)] ;; Named let, because loops are for sissies |