From 8a5303df8f0b3b71e7272a6bf5a2856467fe4bd1 Mon Sep 17 00:00:00 2001 From: Elena Machkasova Date: Sun, 14 Jun 2015 11:11:39 -0500 Subject: [PATCH 01/10] replaced "foo" examples with "hello" This is more novice-friendly --- src/koans/01_equalities.clj | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/koans/01_equalities.clj b/src/koans/01_equalities.clj index ed10b7b..8f76176 100644 --- a/src/koans/01_equalities.clj +++ b/src/koans/01_equalities.clj @@ -24,13 +24,13 @@ (= __ (not (= 1 nil))) "Strings, and keywords, and symbols: oh my!" - (= __ (= "foo" :foo 'foo)) + (= __ (= "hello" :hello 'hello)) "Make a keyword with your keyboard" - (= :foo (keyword __)) + (= :hello (keyword __)) "Symbolism is all around us" - (= 'foo (symbol __)) + (= 'hello (symbol __)) "When things cannot be equal, they must be different" (not= :fill-in-the-blank __)) From 29aedc3a6ae244ef554501dc07ee4d9200006383 Mon Sep 17 00:00:00 2001 From: Brian Dawn Date: Sun, 14 Jun 2015 11:09:15 -0500 Subject: [PATCH 02/10] Made conditionals exercises more novice friendly. --- src/koans/07_conditionals.clj | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/src/koans/07_conditionals.clj b/src/koans/07_conditionals.clj index b33efc6..764cd09 100644 --- a/src/koans/07_conditionals.clj +++ b/src/koans/07_conditionals.clj @@ -1,14 +1,12 @@ (ns koans.07-conditionals (:require [koan-engine.core :refer :all])) -(defn explain-defcon-level [exercise-term] +(defn explain-exercise-velocity [exercise-term] (case exercise-term - :fade-out :you-and-what-army - :double-take :call-me-when-its-important - :round-house :o-rly - :fast-pace :thats-pretty-bad - :cocked-pistol :sirens - :say-what?)) + :bicycling "pretty fast" + :jogging "not super fast" + :walking "not fast at all" + "is that even exercise?")) (meditations "You will face many decisions" @@ -40,10 +38,10 @@ 'doom 'more-doom)) - "In case of emergency, sound the alarms" - (= :sirens - (explain-defcon-level __)) + "In case of emergency, go fast" + (= "pretty fast" + (explain-exercise-velocity __)) "But admit it when you don't know what to do" (= __ - (explain-defcon-level :yo-mama))) + (explain-exercise-velocity :watching-tv))) From 6d5b2263074e5fdc2e0c502a236d011350711577 Mon Sep 17 00:00:00 2001 From: Tom Marble Date: Sun, 14 Jun 2015 21:06:04 -0500 Subject: [PATCH 03/10] attempt to make koans more inclusive --- src/koans/21_group_by.clj | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/koans/21_group_by.clj b/src/koans/21_group_by.clj index 1e845d5..e7a0408 100644 --- a/src/koans/21_group_by.clj +++ b/src/koans/21_group_by.clj @@ -19,20 +19,20 @@ "You can also group by a primary key" (= __ (group-by :id [{:id 1 :name "Bob"} - {:id 2 :name "Mike"} + {:id 2 :name "Jennifer"} {:id 1 :last-name "Smith"} ])) "But be careful when you group by non-required key" (= {"Bob" [{:name "Bob" :id 1}] - "Mike" [{:name "Mike" :id 2}] + "Jennifer" [{:name "Jennifer" :id 2}] __ [{:last-name "Smith" :id 1}]} (group-by :name [{:id 1 :name "Bob"} - {:id 2 :name "Mike"} + {:id 2 :name "Jennifer"} {:id 1 :last-name "Smith"}])) "The true power of group-by comes with custom functions" (= __ (group-by #(if (:bad %) :naughty-list :nice-list) [{:name "Jimmy" :bad true} - {:name "Jack" :bad false} + {:name "Anna" :bad false} {:name "Joe" :bad true}]))) From 54d4b1a9993bfc3674a13c9459dfe435cccc4a66 Mon Sep 17 00:00:00 2001 From: Tom Marble Date: Sun, 14 Jun 2015 21:38:41 -0500 Subject: [PATCH 04/10] refer to clojure.set in 04 --- src/koans/04_sets.clj | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/koans/04_sets.clj b/src/koans/04_sets.clj index 0b5d14e..d6b4063 100644 --- a/src/koans/04_sets.clj +++ b/src/koans/04_sets.clj @@ -1,5 +1,6 @@ (ns koans.04-sets - (:require [koan-engine.core :refer :all])) + (:require [koan-engine.core :refer :all] + [clojure.set :as set])) (meditations "You can create a set by converting another collection" @@ -12,10 +13,10 @@ (= __ (set '(1 1 2 2 3 3 4 4 5 5))) "You can ask clojure for the union of two sets" - (= __ (clojure.set/union #{1 2 3 4} #{2 3 5})) + (= __ (set/union #{1 2 3 4} #{2 3 5})) "And also the intersection" - (= __ (clojure.set/intersection #{1 2 3 4} #{2 3 5})) + (= __ (set/intersection #{1 2 3 4} #{2 3 5})) "But don't forget about the difference" - (= __ (clojure.set/difference #{1 2 3 4 5} #{2 3 5}))) + (= __ (set/difference #{1 2 3 4 5} #{2 3 5}))) From 6866ccd933600ac4dda512ecd927f59ff6cca300 Mon Sep 17 00:00:00 2001 From: Elena Machkasova Date: Sun, 14 Jun 2015 23:35:01 -0500 Subject: [PATCH 05/10] changed another foo to hello --- src/koans/10_lazy_sequences.clj | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/koans/10_lazy_sequences.clj b/src/koans/10_lazy_sequences.clj index 07c6858..ac8e6c4 100644 --- a/src/koans/10_lazy_sequences.clj +++ b/src/koans/10_lazy_sequences.clj @@ -24,5 +24,5 @@ (repeat 10 __)) "Iteration can be used for repetition" - (= (repeat 100 :foo) - (take 100 (iterate ___ :foo)))) + (= (repeat 100 :hello) + (take 100 (iterate ___ :hello)))) From 13262d30b3d320b11416bfe9694852c7d9e4d644 Mon Sep 17 00:00:00 2001 From: Tom Marble Date: Mon, 22 Jun 2015 18:38:36 -0500 Subject: [PATCH 06/10] Added PullRequests.md --- PullRequests.md | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 PullRequests.md diff --git a/PullRequests.md b/PullRequests.md new file mode 100644 index 0000000..da56cd7 --- /dev/null +++ b/PullRequests.md @@ -0,0 +1,9 @@ += Pull Requests + +This is a test of merging from a personal repo to + +clojurebridge-minneapolis/clojure-koans + +Such that at a future time that repo could be merge upstream to + +functional-koans/clojure-koans From 3df3f8999a02956ae0689154617e21cc223a5406 Mon Sep 17 00:00:00 2001 From: Tom Marble Date: Mon, 22 Jun 2015 18:40:31 -0500 Subject: [PATCH 07/10] Minor typo --- PullRequests.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PullRequests.md b/PullRequests.md index da56cd7..4a368d5 100644 --- a/PullRequests.md +++ b/PullRequests.md @@ -1,4 +1,4 @@ -= Pull Requests +# Pull Requests This is a test of merging from a personal repo to From 690f171ccb076d7fb3401347a696709572dbf435 Mon Sep 17 00:00:00 2001 From: Tom Marble Date: Wed, 24 Jun 2015 08:01:42 -0500 Subject: [PATCH 08/10] removed PullRequests.md --- PullRequests.md | 9 --------- 1 file changed, 9 deletions(-) delete mode 100644 PullRequests.md diff --git a/PullRequests.md b/PullRequests.md deleted file mode 100644 index 4a368d5..0000000 --- a/PullRequests.md +++ /dev/null @@ -1,9 +0,0 @@ -# Pull Requests - -This is a test of merging from a personal repo to - -clojurebridge-minneapolis/clojure-koans - -Such that at a future time that repo could be merge upstream to - -functional-koans/clojure-koans From 2a619dbe732e90d15eacf53a6f666479060fe984 Mon Sep 17 00:00:00 2001 From: Tom Marble Date: Wed, 24 Jun 2015 08:15:45 -0500 Subject: [PATCH 09/10] cherry pick upstream delta from 6/14/2015 --- resources/koans.clj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/koans.clj b/resources/koans.clj index 31dc577..3ed9258 100644 --- a/resources/koans.clj +++ b/resources/koans.clj @@ -54,7 +54,7 @@ false "February" 1 "January" - 2006 2010 2014 + 2010 2014 2018 "PyeongChang" "Sochi" "Vancouver"]}] ["06_functions" {"__" [81 From 356844ba0a8ed9e1ece5879de82d2f27644bd981 Mon Sep 17 00:00:00 2001 From: Tom Marble Date: Wed, 24 Jun 2015 14:11:00 -0500 Subject: [PATCH 10/10] Replaced Playground song with Oxford comma --- .gitignore | 2 +- src/koans/14_destructuring.clj | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.gitignore b/.gitignore index 06323cc..cbbcfd7 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ +*~ bin classes lib @@ -8,4 +9,3 @@ target .lein-deps-sum .lein-plugins .lein-repl-history - diff --git a/src/koans/14_destructuring.clj b/src/koans/14_destructuring.clj index 42e0940..de6a9ce 100644 --- a/src/koans/14_destructuring.clj +++ b/src/koans/14_destructuring.clj @@ -12,16 +12,16 @@ [:foo :bar])) "Whether in function definitions" - (= (str "First comes love, " - "then comes marriage, " - "then comes Clojure with the baby carriage") + (= (str "An Oxford comma list of apples, " + "oranges, " + "and pears.") ((fn [[a b c]] __) - ["love" "marriage" "Clojure"])) + ["apples" "oranges" "pears"])) "Or in let expressions" - (= "Rich Hickey aka The Clojurer aka Go Time aka Macro Killah" + (= "Rich Hickey aka The Clojurer aka Go Time aka Lambda Guru" (let [[first-name last-name & aliases] - (list "Rich" "Hickey" "The Clojurer" "Go Time" "Macro Killah")] + (list "Rich" "Hickey" "The Clojurer" "Go Time" "Lambda Guru")] __)) "You can regain the full argument if you like arguing"