~willvaughn/kata

0897c59f727733f991230677d4f787768b6d7256 — William Vaughn 1 year, 5 months ago 902abca
exercism annalyn's infiltration solution
1 files changed, 8 insertions(+), 4 deletions(-)

M exercism/clojure/annalyns-infiltration/src/annalyns_infiltration.clj
M exercism/clojure/annalyns-infiltration/src/annalyns_infiltration.clj => exercism/clojure/annalyns-infiltration/src/annalyns_infiltration.clj +8 -4
@@ 3,19 3,23 @@
(defn can-fast-attack?
  "Returns true if a fast-attack can be made, false otherwise."
  [knight-awake?]
  )
  (not knight-awake?))

(defn can-spy?
  "Returns true if the kidnappers can be spied upon, false otherwise."
  [knight-awake? archer-awake? prisoner-awake?]
  )
  (or knight-awake? archer-awake? prisoner-awake?))

(defn can-signal-prisoner?
  "Returns true if the prisoner can be signalled, false otherwise."
  [archer-awake? prisoner-awake?]
  )
  (and (not archer-awake?) prisoner-awake?))

(defn can-free-prisoner?
  "Returns true if prisoner can be freed, false otherwise."
  [knight-awake? archer-awake? prisoner-awake? dog-present?]
  )
  (if dog-present?
    (not archer-awake?)
    (and prisoner-awake?
         (not archer-awake?)
         (not knight-awake?))))