From 0897c59f727733f991230677d4f787768b6d7256 Mon Sep 17 00:00:00 2001 From: William Vaughn Date: Wed, 14 Dec 2022 08:54:08 -0800 Subject: [PATCH] exercism annalyn's infiltration solution --- .../src/annalyns_infiltration.clj | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/exercism/clojure/annalyns-infiltration/src/annalyns_infiltration.clj b/exercism/clojure/annalyns-infiltration/src/annalyns_infiltration.clj index ebd46f5..f3a5a35 100644 --- a/exercism/clojure/annalyns-infiltration/src/annalyns_infiltration.clj +++ b/exercism/clojure/annalyns-infiltration/src/annalyns_infiltration.clj @@ -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?)))) -- 2.45.2