Change file/ns names for everything and add 02_strings

This commit is contained in:
Striking 2015-09-13 00:28:39 -05:00
parent 13d95a4f50
commit 7498707bc0
23 changed files with 50 additions and 43 deletions

View File

@ -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}

4
src/koans/02_strings.clj Normal file
View File

@ -0,0 +1,4 @@
(ns koans.02-strings
(:require [koan-engine.core :refer :all]))
(meditations)

View File

@ -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!"))))

View File

@ -1,4 +1,4 @@
(ns koans.03-vectors
(ns koans.04-vectors
(:require [koan-engine.core :refer :all]))
(meditations

View File

@ -1,4 +1,4 @@
(ns koans.04-sets
(ns koans.05-sets
(:require [koan-engine.core :refer :all]
[clojure.set :as set]))

View File

@ -1,4 +1,4 @@
(ns koans.05-maps
(ns koans.06-maps
(:require [koan-engine.core :refer :all]))
(meditations

View File

@ -1,4 +1,4 @@
(ns koans.06-functions
(ns koans.07-functions
(:require [koan-engine.core :refer :all]))
(defn multiply-by-ten [n]

View File

@ -1,4 +1,4 @@
(ns koans.07-conditionals
(ns koans.08-conditionals
(:require [koan-engine.core :refer :all]))
(defn explain-exercise-velocity [exercise-term]

View File

@ -1,4 +1,4 @@
(ns koans.08-higher-order-functions
(ns koans.09-higher-order-functions
(:require [koan-engine.core :refer :all]))
(meditations

View File

@ -1,4 +1,4 @@
(ns koans.09-runtime-polymorphism
(ns koans.10-runtime-polymorphism
(:require [koan-engine.core :refer :all]))
(defn hello

View File

@ -1,4 +1,4 @@
(ns koans.10-lazy-sequences
(ns koans.11-lazy-sequences
(:require [koan-engine.core :refer :all]))
(meditations

View File

@ -1,4 +1,4 @@
(ns koans.11-sequence-comprehensions
(ns koans.12-sequence-comprehensions
(:require [koan-engine.core :refer :all]))
(meditations

View File

@ -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))

View File

@ -1,4 +1,4 @@
(ns koans.13-recursion
(ns koans.14-recursion
(:require [koan-engine.core :refer :all]))
(defn is-even? [n]

View File

@ -1,4 +1,4 @@
(ns koans.14-destructuring
(ns koans.15-destructuring
(:require [koan-engine.core :refer :all]))
(def test-address

View File

@ -1,4 +1,4 @@
(ns koans.15-refs
(ns koans.16-refs
(:require [koan-engine.core :refer :all]))
(def the-world (ref "hello"))

View File

@ -1,4 +1,4 @@
(ns koans.16-atoms
(ns koans.17-atoms
(:require [koan-engine.core :refer :all]))
(def atomic-clock (atom 0))

View File

@ -1,4 +1,4 @@
(ns koans.17-macros
(ns koans.18-macros
(:require [koan-engine.core :refer :all]))
(defmacro hello [x]

View File

@ -1,4 +1,4 @@
(ns koans.18-datatypes
(ns koans.19-datatypes
(:require [koan-engine.core :refer :all]))
(defrecord Nobel [prize])

View File

@ -1,4 +1,4 @@
(ns koans.19-java-interop
(ns koans.20-java-interop
(:require [koan-engine.core :refer :all]))
(meditations

View File

@ -1,4 +1,4 @@
(ns koans.20-partition
(ns koans.21-partition
(:require [koan-engine.core :refer :all]))
(meditations

View File

@ -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]

View File

@ -1,4 +1,4 @@
(ns koans.22-meta
(ns koans.23-meta
(:require [koan-engine.core :refer :all]))
(def giants