This file contains 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 minesweeper.solver | |
(:use clojure.test)) | |
(defn solve [scenario] | |
"Example input: {:rows 10 :cols 10 :mines 2}" | |
(let [mines (:mines scenario) | |
rows (:rows scenario) | |
cols (:cols scenario) | |
freecells (- (* rows cols) mines)] | |
(cond |