From b1ea905c5798c1ddb4cadd5af58ba27e356852b3 Mon Sep 17 00:00:00 2001 From: Colin Jones Date: Mon, 6 Jul 2015 07:28:21 -0500 Subject: [PATCH] Update answer sheet for ClojureBridge-MN changes --- resources/koans.clj | 18 +++++++++--------- src/koans/21_group_by.clj | 3 +-- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/resources/koans.clj b/resources/koans.clj index 3ed9258..a8bffb4 100644 --- a/resources/koans.clj +++ b/resources/koans.clj @@ -6,8 +6,8 @@ true true false - "foo" - "foo" + "hello" + "hello" 3]}] ["02_lists" {"__" [1 2 3 4 5 @@ -74,8 +74,8 @@ :glory 4 6 :your-road 1 - :cocked-pistol - :say-what?]}] + :bicycling + "is that even exercise?"]}] ["08_higher_order_functions" {"__" [4 8 12 (* x x) @@ -135,9 +135,9 @@ "___" [not]}] ["14_destructuring" {"__" [":bar:foo" - (format (str "First comes %s, " - "then comes %s, " - "then comes %s with the baby carriage") + (format (str "An Oxford comma list of %s, " + "%s, " + "and %s.") a b c) (apply str (interpose " " @@ -214,9 +214,9 @@ {5 ["hello" "world"] 3 ["foo" "bar"]} {1 [{:name "Bob" :id 1} {:last-name "Smith" :id 1}] - 2 [{:name "Mike" :id 2}]} + 2 [{:name "Jennifer" :id 2}]} nil {:naughty-list [{:name "Jimmy" :bad true} {:name "Joe" :bad true}] - :nice-list [{:name "Jack" :bad false}]}]}] + :nice-list [{:name "Jane" :bad false}]}]}] ] diff --git a/src/koans/21_group_by.clj b/src/koans/21_group_by.clj index e7a0408..f25891a 100644 --- a/src/koans/21_group_by.clj +++ b/src/koans/21_group_by.clj @@ -10,7 +10,6 @@ "To categorize a collection by some function, use group-by." (= __ (group-by count ["hello" "world" "foo" "bar"])) - "You can simulate filter + remove in one pass" (= (get-odds-and-evens [1 2 3 4 5]) ((juxt filter remove) odd? [1 2 3 4 5]) @@ -34,5 +33,5 @@ (= __ (group-by #(if (:bad %) :naughty-list :nice-list) [{:name "Jimmy" :bad true} - {:name "Anna" :bad false} + {:name "Jane" :bad false} {:name "Joe" :bad true}])))