From 7498707bc03ae15713e210b6cba32836161fda91 Mon Sep 17 00:00:00 2001 From: Striking Date: Sun, 13 Sep 2015 00:28:39 -0500 Subject: [PATCH] Change file/ns names for everything and add 02_strings --- resources/koans.clj | 46 ++++++++++--------- src/koans/02_strings.clj | 4 ++ src/koans/{02_lists.clj => 03_lists.clj} | 3 +- src/koans/{03_vectors.clj => 04_vectors.clj} | 2 +- src/koans/{04_sets.clj => 05_sets.clj} | 2 +- src/koans/{05_maps.clj => 06_maps.clj} | 2 +- .../{06_functions.clj => 07_functions.clj} | 2 +- ...7_conditionals.clj => 08_conditionals.clj} | 2 +- ...ions.clj => 09_higher_order_functions.clj} | 2 +- ...rphism.clj => 10_runtime_polymorphism.clj} | 2 +- ...zy_sequences.clj => 11_lazy_sequences.clj} | 2 +- ...ons.clj => 12_sequence_comprehensions.clj} | 2 +- ...unctions.clj => 13_creating_functions.clj} | 2 +- .../{13_recursion.clj => 14_recursion.clj} | 2 +- ...destructuring.clj => 15_destructuring.clj} | 2 +- src/koans/{15_refs.clj => 16_refs.clj} | 2 +- src/koans/{16_atoms.clj => 17_atoms.clj} | 2 +- src/koans/{17_macros.clj => 18_macros.clj} | 2 +- .../{18_datatypes.clj => 19_datatypes.clj} | 2 +- ...9_java_interop.clj => 20_java_interop.clj} | 2 +- .../{20_partition.clj => 21_partition.clj} | 2 +- .../{21_group_by.clj => 22_group_by.clj} | 2 +- src/koans/{22_meta.clj => 23_meta.clj} | 2 +- 23 files changed, 50 insertions(+), 43 deletions(-) create mode 100644 src/koans/02_strings.clj rename src/koans/{02_lists.clj => 03_lists.clj} (98%) rename src/koans/{03_vectors.clj => 04_vectors.clj} (97%) rename src/koans/{04_sets.clj => 05_sets.clj} (97%) rename src/koans/{05_maps.clj => 06_maps.clj} (98%) rename src/koans/{06_functions.clj => 07_functions.clj} (97%) rename src/koans/{07_conditionals.clj => 08_conditionals.clj} (97%) rename src/koans/{08_higher_order_functions.clj => 09_higher_order_functions.clj} (96%) rename src/koans/{09_runtime_polymorphism.clj => 10_runtime_polymorphism.clj} (97%) rename src/koans/{10_lazy_sequences.clj => 11_lazy_sequences.clj} (96%) rename src/koans/{11_sequence_comprehensions.clj => 12_sequence_comprehensions.clj} (96%) rename src/koans/{12_creating_functions.clj => 13_creating_functions.clj} (97%) rename src/koans/{13_recursion.clj => 14_recursion.clj} (98%) rename src/koans/{14_destructuring.clj => 15_destructuring.clj} (97%) rename src/koans/{15_refs.clj => 16_refs.clj} (98%) rename src/koans/{16_atoms.clj => 17_atoms.clj} (97%) rename src/koans/{17_macros.clj => 18_macros.clj} (98%) rename src/koans/{18_datatypes.clj => 19_datatypes.clj} (98%) rename src/koans/{19_java_interop.clj => 20_java_interop.clj} (96%) rename src/koans/{20_partition.clj => 21_partition.clj} (97%) rename src/koans/{21_group_by.clj => 22_group_by.clj} (98%) rename src/koans/{22_meta.clj => 23_meta.clj} (98%) diff --git a/resources/koans.clj b/resources/koans.clj index 19dddc6..77c4d40 100644 --- a/resources/koans.clj +++ b/resources/koans.clj @@ -10,7 +10,11 @@ "hello" 3]}] - ["02_lists" {"__" [1 2 3 4 5 + ["02_strings" {"__" [ + + ]}] + + ["03_lists" {"__" [1 2 3 4 5 1 [2 3 4 5] 3 @@ -23,7 +27,7 @@ "No dice!" ()]}] - ["03_vectors" {"__" [1 + ["04_vectors" {"__" [1 [1] [nil nil] 2 @@ -34,14 +38,14 @@ [:butter :and] 3]}] - ["04_sets" {"__" [[3] + ["05_sets" {"__" [[3] 3 #{1 2 3 4 5} #{1 2 3 4 5} #{2 3} #{1 4}]}] - ["05_maps" {"__" [:b 2 + ["06_maps" {"__" [:b 2 1 2 2 @@ -57,7 +61,7 @@ 2010 2014 2018 "PyeongChang" "Sochi" "Vancouver"]}] - ["06_functions" {"__" [81 + ["07_functions" {"__" [81 20 10 60 @@ -68,7 +72,7 @@ (fn [f] (f 5)) (fn [f] (f 5))]}] - ["07_conditionals" {"__" [:a + ["08_conditionals" {"__" [:a [] nil :glory @@ -77,7 +81,7 @@ :bicycling "is that even exercise?"]}] - ["08_higher_order_functions" {"__" [4 8 12 + ["09_higher_order_functions" {"__" [4 8 12 (* x x) [false false true false false] () @@ -88,14 +92,14 @@ 100 (count a) (count b)]}] - ["09_runtime_polymorphism" {"__" [(str (:name a) " eats veggies.") + ["10_runtime_polymorphism" {"__" [(str (:name a) " eats veggies.") (str (:name a) " eats animals.") (str "I don't know what " (:name a) " eats.") "Hello World!" "Hello, you silly world." "Hello to this group: Peter, Paul, Mary!" ]}] - ["10_lazy_sequences" {"__" [[1 2 3 4] + ["11_lazy_sequences" {"__" [[1 2 3 4] [0 1 2 3 4] 10 95 @@ -103,14 +107,14 @@ :a] "___" [(fn [x] x)]}] - ["11_sequence_comprehensions" {"__" [[0 1 2 3 4 5] + ["12_sequence_comprehensions" {"__" [[0 1 2 3 4 5] (* x x) (range 10) (odd? x) (* x x) [row column] ]}] - ["12_creating_functions" {"__" [true false true + ["13_creating_functions" {"__" [true false true 4 :a :b :c :d :c :d @@ -120,7 +124,7 @@ multiply-by-5 (comp dec square)]}] - ["13_recursion" {"__" [true + ["14_recursion" {"__" [true acc (loop [coll coll acc ()] @@ -134,7 +138,7 @@ (recur (dec n) (* acc n))))] "___" [not]}] - ["14_destructuring" {"__" [":bar:foo" + ["15_destructuring" {"__" [":bar:foo" (format (str "An Oxford comma list of %s, " "%s, " "and %s.") @@ -156,7 +160,7 @@ street-address ", " city ", " state)) ]}] - ["15_refs" {"__" ["hello" + ["16_refs" {"__" ["hello" "hello" "better" "better!!!" @@ -165,7 +169,7 @@ ] "___" [(fn [x] (+ 20 x))]}] - ["16_atoms" {"__" [0 + ["17_atoms" {"__" [0 1 (swap! atomic-clock (partial + 4)) 20 @@ -173,7 +177,7 @@ atomic-clock 20 :fin ]}] - ["17_macros" {"__" [~(first form) + ["18_macros" {"__" [~(first form) ~(nth form 2) form (drop 2 form) @@ -183,7 +187,7 @@ '(* 10 2) '(+ 10 (2 * 3))]}] - ["18_datatypes" {"__" [(print + ["19_datatypes" {"__" [(print (str "You're really the " (.category this) ", " recipient "... sorry.")) @@ -195,7 +199,7 @@ (str "Congratulations on your Best Picture Oscar, " "Evil Alien Conquerors!")]}] - ["19_java_interop" {"__" [java.lang.String + ["20_java_interop" {"__" [java.lang.String "SELECT * FROM" 10 1024 @@ -203,14 +207,14 @@ "___" [#(.toUpperCase %) ] }] - ["20_partition" {"__" [partition + ["21_partition" {"__" [partition [:a :b :c] '((0 1 2) (3 4)) 5 :hello (6 :these :are) ]}] - ["21_group_by" {"__" [odd? + ["22_group_by" {"__" [odd? {5 ["hello" "world"] 3 ["foo" "bar"]} {1 [{:name "Bob" :id 1} {:last-name "Smith" :id 1}] @@ -219,7 +223,7 @@ {:naughty-list [{:name "Jimmy" :bad true} {:name "Joe" :bad true}] :nice-list [{:name "Jane" :bad false}]}]}] - ["22_meta" {"__" [{:league "National League"} + ["23_meta" {"__" [{:league "National League"} {:division "West"} "This doesn't implement the IObj interface" {:foo :bar} diff --git a/src/koans/02_strings.clj b/src/koans/02_strings.clj new file mode 100644 index 0000000..c0738d8 --- /dev/null +++ b/src/koans/02_strings.clj @@ -0,0 +1,4 @@ +(ns koans.02-strings + (:require [koan-engine.core :refer :all])) + +(meditations) diff --git a/src/koans/02_lists.clj b/src/koans/03_lists.clj similarity index 98% rename from src/koans/02_lists.clj rename to src/koans/03_lists.clj index 8cdce7f..dbdf6f5 100644 --- a/src/koans/02_lists.clj +++ b/src/koans/03_lists.clj @@ -1,4 +1,4 @@ -(ns koans.02-lists +(ns koans.03-lists (:require [koan-engine.core :refer :all])) (meditations @@ -43,4 +43,3 @@ (rest '()) (catch IllegalStateException e "No dice!")))) - diff --git a/src/koans/03_vectors.clj b/src/koans/04_vectors.clj similarity index 97% rename from src/koans/03_vectors.clj rename to src/koans/04_vectors.clj index 87146d5..71970f6 100644 --- a/src/koans/03_vectors.clj +++ b/src/koans/04_vectors.clj @@ -1,4 +1,4 @@ -(ns koans.03-vectors +(ns koans.04-vectors (:require [koan-engine.core :refer :all])) (meditations diff --git a/src/koans/04_sets.clj b/src/koans/05_sets.clj similarity index 97% rename from src/koans/04_sets.clj rename to src/koans/05_sets.clj index d6b4063..a6e631f 100644 --- a/src/koans/04_sets.clj +++ b/src/koans/05_sets.clj @@ -1,4 +1,4 @@ -(ns koans.04-sets +(ns koans.05-sets (:require [koan-engine.core :refer :all] [clojure.set :as set])) diff --git a/src/koans/05_maps.clj b/src/koans/06_maps.clj similarity index 98% rename from src/koans/05_maps.clj rename to src/koans/06_maps.clj index 3fbaa34..3466864 100644 --- a/src/koans/05_maps.clj +++ b/src/koans/06_maps.clj @@ -1,4 +1,4 @@ -(ns koans.05-maps +(ns koans.06-maps (:require [koan-engine.core :refer :all])) (meditations diff --git a/src/koans/06_functions.clj b/src/koans/07_functions.clj similarity index 97% rename from src/koans/06_functions.clj rename to src/koans/07_functions.clj index fa3e9a1..4bf40a0 100644 --- a/src/koans/06_functions.clj +++ b/src/koans/07_functions.clj @@ -1,4 +1,4 @@ -(ns koans.06-functions +(ns koans.07-functions (:require [koan-engine.core :refer :all])) (defn multiply-by-ten [n] diff --git a/src/koans/07_conditionals.clj b/src/koans/08_conditionals.clj similarity index 97% rename from src/koans/07_conditionals.clj rename to src/koans/08_conditionals.clj index 764cd09..87b9fdf 100644 --- a/src/koans/07_conditionals.clj +++ b/src/koans/08_conditionals.clj @@ -1,4 +1,4 @@ -(ns koans.07-conditionals +(ns koans.08-conditionals (:require [koan-engine.core :refer :all])) (defn explain-exercise-velocity [exercise-term] diff --git a/src/koans/08_higher_order_functions.clj b/src/koans/09_higher_order_functions.clj similarity index 96% rename from src/koans/08_higher_order_functions.clj rename to src/koans/09_higher_order_functions.clj index 299022b..8b7fd3c 100644 --- a/src/koans/08_higher_order_functions.clj +++ b/src/koans/09_higher_order_functions.clj @@ -1,4 +1,4 @@ -(ns koans.08-higher-order-functions +(ns koans.09-higher-order-functions (:require [koan-engine.core :refer :all])) (meditations diff --git a/src/koans/09_runtime_polymorphism.clj b/src/koans/10_runtime_polymorphism.clj similarity index 97% rename from src/koans/09_runtime_polymorphism.clj rename to src/koans/10_runtime_polymorphism.clj index 3e3e76b..8be1c6a 100644 --- a/src/koans/09_runtime_polymorphism.clj +++ b/src/koans/10_runtime_polymorphism.clj @@ -1,4 +1,4 @@ -(ns koans.09-runtime-polymorphism +(ns koans.10-runtime-polymorphism (:require [koan-engine.core :refer :all])) (defn hello diff --git a/src/koans/10_lazy_sequences.clj b/src/koans/11_lazy_sequences.clj similarity index 96% rename from src/koans/10_lazy_sequences.clj rename to src/koans/11_lazy_sequences.clj index 061fab1..1023785 100644 --- a/src/koans/10_lazy_sequences.clj +++ b/src/koans/11_lazy_sequences.clj @@ -1,4 +1,4 @@ -(ns koans.10-lazy-sequences +(ns koans.11-lazy-sequences (:require [koan-engine.core :refer :all])) (meditations diff --git a/src/koans/11_sequence_comprehensions.clj b/src/koans/12_sequence_comprehensions.clj similarity index 96% rename from src/koans/11_sequence_comprehensions.clj rename to src/koans/12_sequence_comprehensions.clj index be8462e..f131e1a 100644 --- a/src/koans/11_sequence_comprehensions.clj +++ b/src/koans/12_sequence_comprehensions.clj @@ -1,4 +1,4 @@ -(ns koans.11-sequence-comprehensions +(ns koans.12-sequence-comprehensions (:require [koan-engine.core :refer :all])) (meditations diff --git a/src/koans/12_creating_functions.clj b/src/koans/13_creating_functions.clj similarity index 97% rename from src/koans/12_creating_functions.clj rename to src/koans/13_creating_functions.clj index 1ade8ae..7d84bc8 100644 --- a/src/koans/12_creating_functions.clj +++ b/src/koans/13_creating_functions.clj @@ -1,4 +1,4 @@ -(ns koans.12-creating-functions +(ns koans.13-creating-functions (:require [koan-engine.core :refer :all])) (defn square [x] (* x x)) diff --git a/src/koans/13_recursion.clj b/src/koans/14_recursion.clj similarity index 98% rename from src/koans/13_recursion.clj rename to src/koans/14_recursion.clj index 0bfcf6a..4c39666 100644 --- a/src/koans/13_recursion.clj +++ b/src/koans/14_recursion.clj @@ -1,4 +1,4 @@ -(ns koans.13-recursion +(ns koans.14-recursion (:require [koan-engine.core :refer :all])) (defn is-even? [n] diff --git a/src/koans/14_destructuring.clj b/src/koans/15_destructuring.clj similarity index 97% rename from src/koans/14_destructuring.clj rename to src/koans/15_destructuring.clj index de6a9ce..32fc983 100644 --- a/src/koans/14_destructuring.clj +++ b/src/koans/15_destructuring.clj @@ -1,4 +1,4 @@ -(ns koans.14-destructuring +(ns koans.15-destructuring (:require [koan-engine.core :refer :all])) (def test-address diff --git a/src/koans/15_refs.clj b/src/koans/16_refs.clj similarity index 98% rename from src/koans/15_refs.clj rename to src/koans/16_refs.clj index ea96e50..3395f29 100644 --- a/src/koans/15_refs.clj +++ b/src/koans/16_refs.clj @@ -1,4 +1,4 @@ -(ns koans.15-refs +(ns koans.16-refs (:require [koan-engine.core :refer :all])) (def the-world (ref "hello")) diff --git a/src/koans/16_atoms.clj b/src/koans/17_atoms.clj similarity index 97% rename from src/koans/16_atoms.clj rename to src/koans/17_atoms.clj index cc782d7..17d92dd 100644 --- a/src/koans/16_atoms.clj +++ b/src/koans/17_atoms.clj @@ -1,4 +1,4 @@ -(ns koans.16-atoms +(ns koans.17-atoms (:require [koan-engine.core :refer :all])) (def atomic-clock (atom 0)) diff --git a/src/koans/17_macros.clj b/src/koans/18_macros.clj similarity index 98% rename from src/koans/17_macros.clj rename to src/koans/18_macros.clj index d1dfcca..931dc75 100644 --- a/src/koans/17_macros.clj +++ b/src/koans/18_macros.clj @@ -1,4 +1,4 @@ -(ns koans.17-macros +(ns koans.18-macros (:require [koan-engine.core :refer :all])) (defmacro hello [x] diff --git a/src/koans/18_datatypes.clj b/src/koans/19_datatypes.clj similarity index 98% rename from src/koans/18_datatypes.clj rename to src/koans/19_datatypes.clj index 0bad914..d6eb31f 100644 --- a/src/koans/18_datatypes.clj +++ b/src/koans/19_datatypes.clj @@ -1,4 +1,4 @@ -(ns koans.18-datatypes +(ns koans.19-datatypes (:require [koan-engine.core :refer :all])) (defrecord Nobel [prize]) diff --git a/src/koans/19_java_interop.clj b/src/koans/20_java_interop.clj similarity index 96% rename from src/koans/19_java_interop.clj rename to src/koans/20_java_interop.clj index 4ebd9d5..8a7a6e2 100644 --- a/src/koans/19_java_interop.clj +++ b/src/koans/20_java_interop.clj @@ -1,4 +1,4 @@ -(ns koans.19-java-interop +(ns koans.20-java-interop (:require [koan-engine.core :refer :all])) (meditations diff --git a/src/koans/20_partition.clj b/src/koans/21_partition.clj similarity index 97% rename from src/koans/20_partition.clj rename to src/koans/21_partition.clj index 75dfc35..1a65620 100644 --- a/src/koans/20_partition.clj +++ b/src/koans/21_partition.clj @@ -1,4 +1,4 @@ -(ns koans.20-partition +(ns koans.21-partition (:require [koan-engine.core :refer :all])) (meditations diff --git a/src/koans/21_group_by.clj b/src/koans/22_group_by.clj similarity index 98% rename from src/koans/21_group_by.clj rename to src/koans/22_group_by.clj index c2d5377..01de423 100644 --- a/src/koans/21_group_by.clj +++ b/src/koans/22_group_by.clj @@ -1,4 +1,4 @@ -(ns koans.21-group-by +(ns koans.22-group-by (:require [koan-engine.core :refer :all])) (defn get-odds-and-evens [coll] diff --git a/src/koans/22_meta.clj b/src/koans/23_meta.clj similarity index 98% rename from src/koans/22_meta.clj rename to src/koans/23_meta.clj index 7d69081..45fec03 100644 --- a/src/koans/22_meta.clj +++ b/src/koans/23_meta.clj @@ -1,4 +1,4 @@ -(ns koans.22-meta +(ns koans.23-meta (:require [koan-engine.core :refer :all])) (def giants