From c0cc0e32fb08ec850d759add0e5959f17821da59 Mon Sep 17 00:00:00 2001 From: Colin Jones Date: Wed, 27 Oct 2010 00:04:32 -0500 Subject: [PATCH] Update answer key and add vector function. --- src/koans/vectors.clj | 7 +++++-- src/path_to_answer_sheet.clj | 5 +++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/koans/vectors.clj b/src/koans/vectors.clj index 38abcda..b0500f3 100644 --- a/src/koans/vectors.clj +++ b/src/koans/vectors.clj @@ -1,13 +1,16 @@ (meditations "You can use vectors in clojure to create an 'Array' like structure" - (= __ (.size (vec nil))) + (= __ (.size [])) - "You can create a vector in two ways" + "You can create a vector in several ways" (= __ (vec nil)) "And populate it in either of these ways" (= __ (vec '(1))) + "There is another way as well" + (= __ (vector nil)) + "But you can populate it with any number of elements at once" (= [1 __] (vec '(1 2))) diff --git a/src/path_to_answer_sheet.clj b/src/path_to_answer_sheet.clj index 23ce579..7ecab34 100644 --- a/src/path_to_answer_sheet.clj +++ b/src/path_to_answer_sheet.clj @@ -19,8 +19,12 @@ "\"No dice!\"" "()"]} "vectors" {"__" [0 + [] + [1] + [nil] 2 [333] + :peanut :jelly :jelly [:butter :and]]} @@ -35,6 +39,7 @@ 1 1 "\"Vancouver\"" + nil true false "\"February\""