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 solve-logic-puzzle [] | |
(let [people [:amaya :bailey :jamari :jason :landon]] | |
(first | |
(for [[fortune time cosmopolitan us-weekly vogue] (permutations people) ; magazines | |
[asiago blue-cheese mascarpone mozzarella muenster] (permutations people) ; cheeses | |
; We bind the reservations in two steps, so we have a name for the overall order | |
reservations (permutations people) | |
:let [[five six seven seven-thirty eight-thirty] reservations] | |
; THE CONSTRAINTS IN PLAIN ENGLISH |
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
;; Ref-based Santa Claus solution, Written by Mark Engelberg | |
;; (start-simulation) to run | |
(def *num-elves* 10) | |
(def *num-reindeer* 9) | |
;; Santa is a ref containing either {:state :asleep} or {:state :busy, :busy-with <sequence-of-workers>} | |
(def santa (ref {:state :asleep})) | |
(defn waiting-room [capacity] |
NewerOlder