From a55623398f6374a5caf2b0d0d2272bcc56da0b5b Mon Sep 17 00:00:00 2001 From: brannx Date: Thu, 15 Mar 2018 15:27:15 +0300 Subject: [PATCH] Update 04_vectors.clj --- src/koans/04_vectors.clj | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/koans/04_vectors.clj b/src/koans/04_vectors.clj index 71970f6..0076391 100644 --- a/src/koans/04_vectors.clj +++ b/src/koans/04_vectors.clj @@ -2,32 +2,32 @@ (:require [koan-engine.core :refer :all])) (meditations - "You can use vectors in clojure as array-like structures" + "Векторы в Clojure похожи на массивы" (= __ (count [42])) - "You can create a vector from a list" + "Можно их содать из списка" (= __ (vec '(1))) - "Or from some elements" + "Или из ничего" (= __ (vector nil nil)) - "But you can populate it with any number of elements at once" + "Число элементов — ваше дело" (= [1 __] (vec '(1 2))) - "Conjoining to a vector is different than to a list" + "Добавляем элемент, помним что вектор «похож» на массив" (= __ (conj [111 222] 333)) - "You can get the first element of a vector like so" + "Получаем первый элемент" (= __ (first [:peanut :butter :and :jelly])) - "And the last in a similar fashion" + "Последний элемент" (= __ (last [:peanut :butter :and :jelly])) - "Or any index if you wish" + "Да какой угодно элемент" (= __ (nth [:peanut :butter :and :jelly] 3)) - "You can also slice a vector" + "Нарезаем вектор" (= __ (subvec [:peanut :butter :and :jelly] 1 3)) - "Equality with collections is in terms of values" + "Коллекции сравниваются по их элементам" (= (list 1 2 3) (vector 1 2 __)))