diff --git a/src/sicp/chapter_1/ex_1_1.clj b/src/sicp/chapter_1/part_1/ex_1_1.clj similarity index 97% rename from src/sicp/chapter_1/ex_1_1.clj rename to src/sicp/chapter_1/part_1/ex_1_1.clj index cbeab2d..5a4a097 100644 --- a/src/sicp/chapter_1/ex_1_1.clj +++ b/src/sicp/chapter_1/part_1/ex_1_1.clj @@ -1,4 +1,4 @@ -(ns sicp.chapter-1.ex-1-1) +(ns sicp.chapter-1.part_1.ex-1-1) ; Exercise 1.1 ; Below is a sequence of expressions. diff --git a/src/sicp/chapter_1/ex_1_2.clj b/src/sicp/chapter_1/part_1/ex_1_2.clj similarity index 87% rename from src/sicp/chapter_1/ex_1_2.clj rename to src/sicp/chapter_1/part_1/ex_1_2.clj index e2425b8..6f9e511 100644 --- a/src/sicp/chapter_1/ex_1_2.clj +++ b/src/sicp/chapter_1/part_1/ex_1_2.clj @@ -1,4 +1,4 @@ -(ns sicp.chapter_1.ex-1-2) +(ns sicp.chapter_1.part_1.ex-1-2) ; Exercise 1.2 ; Translate the following expression into prefix form: diff --git a/src/sicp/chapter_1/ex_1_3.clj b/src/sicp/chapter_1/part_1/ex_1_3.clj similarity index 90% rename from src/sicp/chapter_1/ex_1_3.clj rename to src/sicp/chapter_1/part_1/ex_1_3.clj index 3fae64a..12885d4 100644 --- a/src/sicp/chapter_1/ex_1_3.clj +++ b/src/sicp/chapter_1/part_1/ex_1_3.clj @@ -1,4 +1,4 @@ -(ns sicp.chapter-1.ex-1-3) +(ns sicp.chapter-1.part_1.ex-1-3) ; Exercise 1.3 ; Define a procedure that takes three numbers as arguments and returns the sum of the squares of the two diff --git a/src/sicp/chapter_1/ex_1_4.clj b/src/sicp/chapter_1/part_1/ex_1_4.clj similarity index 88% rename from src/sicp/chapter_1/ex_1_4.clj rename to src/sicp/chapter_1/part_1/ex_1_4.clj index c346a90..35e286d 100644 --- a/src/sicp/chapter_1/ex_1_4.clj +++ b/src/sicp/chapter_1/part_1/ex_1_4.clj @@ -1,4 +1,4 @@ -(ns sicp.chapter-1.ex-1-4) +(ns sicp.chapter-1.part_1.ex-1-4) ; Exercise 1.4 ; Observe that our model of evaluation allows for combinations whose operators are compound expressions. diff --git a/src/sicp/chapter_1/ex_1_5.clj b/src/sicp/chapter_1/part_1/ex_1_5.clj similarity index 95% rename from src/sicp/chapter_1/ex_1_5.clj rename to src/sicp/chapter_1/part_1/ex_1_5.clj index 93eeeeb..5e2e594 100644 --- a/src/sicp/chapter_1/ex_1_5.clj +++ b/src/sicp/chapter_1/part_1/ex_1_5.clj @@ -1,4 +1,4 @@ -(ns sicp.chapter-1.ex-1-5) +(ns sicp.chapter-1.part_1.ex-1-5) ; Exercise 1.5 ; Ben Bitdiddle has invented a test to determine whether the interpreter he is faced with is diff --git a/src/sicp/chapter_1/ex_1_6.clj b/src/sicp/chapter_1/part_1/ex_1_6.clj similarity index 97% rename from src/sicp/chapter_1/ex_1_6.clj rename to src/sicp/chapter_1/part_1/ex_1_6.clj index 365d606..6871a99 100644 --- a/src/sicp/chapter_1/ex_1_6.clj +++ b/src/sicp/chapter_1/part_1/ex_1_6.clj @@ -1,4 +1,4 @@ -(ns sicp.chapter-1.ex-1-6) +(ns sicp.chapter-1.part_1.ex-1-6) ; Exercise 1.6 ; Alyssa P. Hacker doesn’t see why if needs to be provided as a special form. diff --git a/src/sicp/chapter_1/ex_1_7.clj b/src/sicp/chapter_1/part_1/ex_1_7.clj similarity index 97% rename from src/sicp/chapter_1/ex_1_7.clj rename to src/sicp/chapter_1/part_1/ex_1_7.clj index 46ad1d5..b3846d5 100644 --- a/src/sicp/chapter_1/ex_1_7.clj +++ b/src/sicp/chapter_1/part_1/ex_1_7.clj @@ -1,4 +1,4 @@ -(ns sicp.chapter-1.ex-1-7) +(ns sicp.chapter-1.part_1.ex-1-7) ; Exercise 1.7 ; The `good-enough?` test used in computing square roots will not be very effective diff --git a/src/sicp/chapter_1/ex_1_8.clj b/src/sicp/chapter_1/part_1/ex_1_8.clj similarity index 95% rename from src/sicp/chapter_1/ex_1_8.clj rename to src/sicp/chapter_1/part_1/ex_1_8.clj index 7d4ee77..62d509d 100644 --- a/src/sicp/chapter_1/ex_1_8.clj +++ b/src/sicp/chapter_1/part_1/ex_1_8.clj @@ -1,4 +1,4 @@ -(ns sicp.chapter-1.ex-1-8) +(ns sicp.chapter-1.part_1.ex-1-8) ; Exercise 1.8 ; Newton’s method for cube roots is based on the fact that if y diff --git a/src/sicp/chapter_1/ex_1_10.clj b/src/sicp/chapter_1/part_2/ex_1_10.clj similarity index 94% rename from src/sicp/chapter_1/ex_1_10.clj rename to src/sicp/chapter_1/part_2/ex_1_10.clj index 466f5c4..4ffb7b1 100644 --- a/src/sicp/chapter_1/ex_1_10.clj +++ b/src/sicp/chapter_1/part_2/ex_1_10.clj @@ -1,4 +1,4 @@ -(ns sicp.chapter-1.ex-1-10) +(ns sicp.chapter-1.part_2.ex-1-10) ; Exercise 1.10 ; The following procedure computes a mathematical function called Ackermann’s function. diff --git a/src/sicp/chapter_1/ex_1_11.clj b/src/sicp/chapter_1/part_2/ex_1_11.clj similarity index 95% rename from src/sicp/chapter_1/ex_1_11.clj rename to src/sicp/chapter_1/part_2/ex_1_11.clj index a145781..5d60140 100644 --- a/src/sicp/chapter_1/ex_1_11.clj +++ b/src/sicp/chapter_1/part_2/ex_1_11.clj @@ -1,4 +1,4 @@ -(ns sicp.chapter-1.ex-1-11) +(ns sicp.chapter-1.part_2.ex-1-11) ; Exercise 1.11 ; A function f is defined by the rule that f(n)=n diff --git a/src/sicp/chapter_1/ex_1_12.clj b/src/sicp/chapter_1/part_2/ex_1_12.clj similarity index 93% rename from src/sicp/chapter_1/ex_1_12.clj rename to src/sicp/chapter_1/part_2/ex_1_12.clj index f3dccfc..3974a7d 100644 --- a/src/sicp/chapter_1/ex_1_12.clj +++ b/src/sicp/chapter_1/part_2/ex_1_12.clj @@ -1,4 +1,4 @@ -(ns sicp.chapter-1.ex-1-12) +(ns sicp.chapter-1.part_2.ex-1-12) ; Exercise 1.12 ; The following pattern of numbers is called Pascal’s triangle. diff --git a/src/sicp/chapter_1/ex_1_13.clj b/src/sicp/chapter_1/part_2/ex_1_13.clj similarity index 89% rename from src/sicp/chapter_1/ex_1_13.clj rename to src/sicp/chapter_1/part_2/ex_1_13.clj index 0c6c973..71f53da 100644 --- a/src/sicp/chapter_1/ex_1_13.clj +++ b/src/sicp/chapter_1/part_2/ex_1_13.clj @@ -1,4 +1,4 @@ -(ns sicp.chapter-1.ex-1-13) +(ns sicp.chapter-1.part_2.ex-1-13) ; Exercise 1.13 ; Prove that Fib(n) is the closest integer to φn/5⎯√, where φ=(1+5⎯√)/2. diff --git a/src/sicp/chapter_1/ex_1_14.clj b/src/sicp/chapter_1/part_2/ex_1_14.clj similarity index 95% rename from src/sicp/chapter_1/ex_1_14.clj rename to src/sicp/chapter_1/part_2/ex_1_14.clj index 9947b04..ac6cbee 100644 --- a/src/sicp/chapter_1/ex_1_14.clj +++ b/src/sicp/chapter_1/part_2/ex_1_14.clj @@ -1,4 +1,4 @@ -(ns sicp.chapter-1.ex-1-14) +(ns sicp.chapter-1.part_2.ex-1-14) ; Exercise 1.14 ; Draw the tree illustrating the process generated by the count-change procedure of 1.2.2 in making change for 11 cents. diff --git a/src/sicp/chapter_1/ex_1_15.clj b/src/sicp/chapter_1/part_2/ex_1_15.clj similarity index 96% rename from src/sicp/chapter_1/ex_1_15.clj rename to src/sicp/chapter_1/part_2/ex_1_15.clj index b926226..4859761 100644 --- a/src/sicp/chapter_1/ex_1_15.clj +++ b/src/sicp/chapter_1/part_2/ex_1_15.clj @@ -1,4 +1,4 @@ -(ns sicp.chapter-1.ex_1_15) +(ns sicp.chapter-1.part_2.ex_1_15) ; Exercise 1.15 ; The sine of an angle (specified in radians) can be computed by making use of the approximation sinx≈x diff --git a/src/sicp/chapter_1/ex_1_16.clj b/src/sicp/chapter_1/part_2/ex_1_16.clj similarity index 96% rename from src/sicp/chapter_1/ex_1_16.clj rename to src/sicp/chapter_1/part_2/ex_1_16.clj index 3d7ba0a..850ce28 100644 --- a/src/sicp/chapter_1/ex_1_16.clj +++ b/src/sicp/chapter_1/part_2/ex_1_16.clj @@ -1,4 +1,4 @@ -(ns sicp.chapter-1.ex-1-16) +(ns sicp.chapter-1.part_2.ex-1-16) ; Exercise 1.16 ; Design a procedure that evolves an iterative exponentiation process diff --git a/src/sicp/chapter_1/ex_1_17.clj b/src/sicp/chapter_1/part_2/ex_1_17.clj similarity index 96% rename from src/sicp/chapter_1/ex_1_17.clj rename to src/sicp/chapter_1/part_2/ex_1_17.clj index 8be953f..9646292 100644 --- a/src/sicp/chapter_1/ex_1_17.clj +++ b/src/sicp/chapter_1/part_2/ex_1_17.clj @@ -1,4 +1,4 @@ -(ns sicp.chapter-1.ex-1-17) +(ns sicp.chapter-1.part_2.ex-1-17) ; Exercise 1.17 ; The exponentiation algorithms in this section are based on performing exponentiation by means of repeated diff --git a/src/sicp/chapter_1/ex_1_18.clj b/src/sicp/chapter_1/part_2/ex_1_18.clj similarity index 88% rename from src/sicp/chapter_1/ex_1_18.clj rename to src/sicp/chapter_1/part_2/ex_1_18.clj index d255a4b..e1b71be 100644 --- a/src/sicp/chapter_1/ex_1_18.clj +++ b/src/sicp/chapter_1/part_2/ex_1_18.clj @@ -1,5 +1,5 @@ -(ns sicp.chapter-1.ex-1-18 - (:require [sicp.chapter-1.ex-1-16 :refer [expt]])) +(ns sicp.chapter-1.part_2.ex-1-18 + (:require [sicp.chapter-1.part_2.ex-1-16 :refer [expt]])) ; Exercise 1.18 ; Using the results of Exercise 1.16 and Exercise 1.17, devise a procedure that generates an iterative diff --git a/src/sicp/chapter_1/ex_1_19.clj b/src/sicp/chapter_1/part_2/ex_1_19.clj similarity index 98% rename from src/sicp/chapter_1/ex_1_19.clj rename to src/sicp/chapter_1/part_2/ex_1_19.clj index d655a7d..1390368 100644 --- a/src/sicp/chapter_1/ex_1_19.clj +++ b/src/sicp/chapter_1/part_2/ex_1_19.clj @@ -1,4 +1,4 @@ -(ns sicp.chapter-1.ex-1-19) +(ns sicp.chapter-1.part_2.ex-1-19) ; Exercise 1.19. ; diff --git a/src/sicp/chapter_1/ex_1_20.clj b/src/sicp/chapter_1/part_2/ex_1_20.clj similarity index 95% rename from src/sicp/chapter_1/ex_1_20.clj rename to src/sicp/chapter_1/part_2/ex_1_20.clj index ff05dfa..4ef88e9 100644 --- a/src/sicp/chapter_1/ex_1_20.clj +++ b/src/sicp/chapter_1/part_2/ex_1_20.clj @@ -1,4 +1,4 @@ -(ns sicp.chapter-1.ex-1-20) +(ns sicp.chapter-1.part_2.ex-1-20) ; Exercise 1.20 ; The process that a procedure generates is of course dependent on the rules used by the interpreter. diff --git a/src/sicp/chapter_1/ex_1_21.clj b/src/sicp/chapter_1/part_2/ex_1_21.clj similarity index 92% rename from src/sicp/chapter_1/ex_1_21.clj rename to src/sicp/chapter_1/part_2/ex_1_21.clj index 92fbf8a..a8f8dfe 100644 --- a/src/sicp/chapter_1/ex_1_21.clj +++ b/src/sicp/chapter_1/part_2/ex_1_21.clj @@ -1,4 +1,4 @@ -(ns sicp.chapter-1.ex-1-21) +(ns sicp.chapter-1.part_2.ex-1-21) ; Exercise 1.21 ; Use the smallest-divisor procedure to find the smallest divisor of each of the following numbers: diff --git a/src/sicp/chapter_1/ex_1_22.clj b/src/sicp/chapter_1/part_2/ex_1_22.clj similarity index 98% rename from src/sicp/chapter_1/ex_1_22.clj rename to src/sicp/chapter_1/part_2/ex_1_22.clj index 51fa04c..b74dd8e 100644 --- a/src/sicp/chapter_1/ex_1_22.clj +++ b/src/sicp/chapter_1/part_2/ex_1_22.clj @@ -1,4 +1,4 @@ -(ns sicp.chapter-1.ex-1-22) +(ns sicp.chapter-1.part_2.ex-1-22) ; Exercise 1.22 ; Most Lisp implementations include a primitive called runtime that returns an integer that specifies diff --git a/src/sicp/chapter_1/ex_1_9.clj b/src/sicp/chapter_1/part_2/ex_1_9.clj similarity index 94% rename from src/sicp/chapter_1/ex_1_9.clj rename to src/sicp/chapter_1/part_2/ex_1_9.clj index ce055b2..f3a6d3e 100644 --- a/src/sicp/chapter_1/ex_1_9.clj +++ b/src/sicp/chapter_1/part_2/ex_1_9.clj @@ -1,4 +1,4 @@ -(ns sicp.chapter-1.ex-1-9) +(ns sicp.chapter-1.part_2.ex-1-9) ; Exercise 1.9 ; Each of the following two procedures defines a method for adding two positive integers diff --git a/test/sicp/chapter_1/ex_1_18_test.clj b/test/sicp/chapter_1/ex_1_18_test.clj deleted file mode 100644 index 68772df..0000000 --- a/test/sicp/chapter_1/ex_1_18_test.clj +++ /dev/null @@ -1,6 +0,0 @@ -(ns sicp.chapter-1.ex-1-18-test - (:require [clojure.test :refer :all]) - (:require [sicp.chapter-1.ex-1-18 :refer [mult]])) - -(deftest mult-test - (is (= 0 (mult 0 19)))) diff --git a/test/sicp/chapter_1/ex_1_3_test.clj b/test/sicp/chapter_1/part_1/ex_1_3_test.clj similarity index 69% rename from test/sicp/chapter_1/ex_1_3_test.clj rename to test/sicp/chapter_1/part_1/ex_1_3_test.clj index 0afaaea..56cf98a 100644 --- a/test/sicp/chapter_1/ex_1_3_test.clj +++ b/test/sicp/chapter_1/part_1/ex_1_3_test.clj @@ -1,6 +1,6 @@ -(ns sicp.chapter-1.ex-1-3-test +(ns sicp.chapter-1.part_1.ex-1-3-test (:require [clojure.test :refer :all] - [sicp.chapter-1.ex-1-3 :refer [sum-larger-numbers-square]])) + [sicp.chapter-1.part_1.ex-1-3 :refer [sum-larger-numbers-square]])) (deftest sum-larger-numbers-square-test (is (= 2 (sum-larger-numbers-square 1 1 1))) diff --git a/test/sicp/chapter_1/ex_1_4_test.clj b/test/sicp/chapter_1/part_1/ex_1_4_test.clj similarity index 65% rename from test/sicp/chapter_1/ex_1_4_test.clj rename to test/sicp/chapter_1/part_1/ex_1_4_test.clj index acf0088..378b531 100644 --- a/test/sicp/chapter_1/ex_1_4_test.clj +++ b/test/sicp/chapter_1/part_1/ex_1_4_test.clj @@ -1,6 +1,6 @@ -(ns sicp.chapter-1.ex-1-4-test +(ns sicp.chapter-1.part_1.ex-1-4-test (:require [clojure.test :refer :all] - [sicp.chapter-1.ex-1-4 :refer [a-plus-abs-b]])) + [sicp.chapter-1.part_1.ex-1-4 :refer [a-plus-abs-b]])) (deftest a-plus-abs-b-test (is (= 2 (a-plus-abs-b 1 1))) diff --git a/test/sicp/chapter_1/ex_1_5_test.clj b/test/sicp/chapter_1/part_1/ex_1_5_test.clj similarity index 77% rename from test/sicp/chapter_1/ex_1_5_test.clj rename to test/sicp/chapter_1/part_1/ex_1_5_test.clj index f4d6b78..2368f3c 100644 --- a/test/sicp/chapter_1/ex_1_5_test.clj +++ b/test/sicp/chapter_1/part_1/ex_1_5_test.clj @@ -1,6 +1,6 @@ -(ns sicp.chapter-1.ex-1-5-test +(ns sicp.chapter-1.part_1.ex-1-5-test (:require [clojure.test :refer :all] - [sicp.chapter-1.ex-1-5 :refer [test_1_5 p]])) + [sicp.chapter-1.part_1.ex-1-5 :refer [test_1_5 p]])) (deftest test_1_5-test ; Normal: Operand "p" will not be evaluated until it's needed by some primitive operation. So result is 0. diff --git a/test/sicp/chapter_1/ex_1_6_test.clj b/test/sicp/chapter_1/part_1/ex_1_6_test.clj similarity index 79% rename from test/sicp/chapter_1/ex_1_6_test.clj rename to test/sicp/chapter_1/part_1/ex_1_6_test.clj index d597852..6cc951a 100644 --- a/test/sicp/chapter_1/ex_1_6_test.clj +++ b/test/sicp/chapter_1/part_1/ex_1_6_test.clj @@ -1,6 +1,6 @@ -(ns sicp.chapter-1.ex-1-6-test +(ns sicp.chapter-1.part_1.ex-1-6-test (:require [clojure.test :refer :all] - [sicp.chapter-1.ex-1-6 :refer [sqrt-iter sqrt-iter-new-if]])) + [sicp.chapter-1.part_1.ex-1-6 :refer [sqrt-iter sqrt-iter-new-if]])) (deftest sqrt-iter-test ; Expected diff --git a/test/sicp/chapter_1/ex_1_7_test.clj b/test/sicp/chapter_1/part_1/ex_1_7_test.clj similarity index 95% rename from test/sicp/chapter_1/ex_1_7_test.clj rename to test/sicp/chapter_1/part_1/ex_1_7_test.clj index 54551de..2d76ccd 100644 --- a/test/sicp/chapter_1/ex_1_7_test.clj +++ b/test/sicp/chapter_1/part_1/ex_1_7_test.clj @@ -1,6 +1,6 @@ -(ns sicp.chapter-1.ex-1-7-test +(ns sicp.chapter-1.part_1.ex-1-7-test (:require [clojure.test :refer :all] - [sicp.chapter-1.ex-1-7 :refer [sqrt-iter sqrt-iter-v2]])) + [sicp.chapter-1.part_1.ex-1-7 :refer [sqrt-iter sqrt-iter-v2]])) (deftest sqrt-iter-test ; 1.0 diff --git a/test/sicp/chapter_1/ex_1_8_test.clj b/test/sicp/chapter_1/part_1/ex_1_8_test.clj similarity index 76% rename from test/sicp/chapter_1/ex_1_8_test.clj rename to test/sicp/chapter_1/part_1/ex_1_8_test.clj index 593cb1f..4f8d324 100644 --- a/test/sicp/chapter_1/ex_1_8_test.clj +++ b/test/sicp/chapter_1/part_1/ex_1_8_test.clj @@ -1,6 +1,6 @@ -(ns sicp.chapter-1.ex-1-8-test +(ns sicp.chapter-1.part_1.ex-1-8-test (:require [clojure.test :refer :all] - [sicp.chapter-1.ex-1-8 :refer [cube-root-iter]])) + [sicp.chapter-1.part_1.ex-1-8 :refer [cube-root-iter]])) (deftest cube-root-iter-test ; 1.0 diff --git a/test/sicp/chapter_1/ex_1_10_test.clj b/test/sicp/chapter_1/part_2/ex_1_10_test.clj similarity index 66% rename from test/sicp/chapter_1/ex_1_10_test.clj rename to test/sicp/chapter_1/part_2/ex_1_10_test.clj index d93f2eb..dab2847 100644 --- a/test/sicp/chapter_1/ex_1_10_test.clj +++ b/test/sicp/chapter_1/part_2/ex_1_10_test.clj @@ -1,6 +1,6 @@ -(ns sicp.chapter-1.ex-1-10-test +(ns sicp.chapter-1.part_2.ex-1-10-test (:require [clojure.test :refer :all] - [sicp.chapter-1.ex-1-10 :refer [A f g h k]])) + [sicp.chapter-1.part_2.ex-1-10 :refer [A f g h k]])) (deftest A-test (is (= 1024 (A 1 10))) diff --git a/test/sicp/chapter_1/ex_1_11_test.clj b/test/sicp/chapter_1/part_2/ex_1_11_test.clj similarity index 96% rename from test/sicp/chapter_1/ex_1_11_test.clj rename to test/sicp/chapter_1/part_2/ex_1_11_test.clj index 1026c43..b46edb2 100644 --- a/test/sicp/chapter_1/ex_1_11_test.clj +++ b/test/sicp/chapter_1/part_2/ex_1_11_test.clj @@ -1,6 +1,6 @@ -(ns sicp.chapter-1.ex-1-11-test +(ns sicp.chapter-1.part_2.ex-1-11-test (:require [clojure.test :refer :all] - [sicp.chapter-1.ex-1-11 :refer [f f-v2]])) + [sicp.chapter-1.part_2.ex-1-11 :refer [f f-v2]])) (deftest f-test ; ~ O(3^n) diff --git a/test/sicp/chapter_1/ex_1_12_test.clj b/test/sicp/chapter_1/part_2/ex_1_12_test.clj similarity index 68% rename from test/sicp/chapter_1/ex_1_12_test.clj rename to test/sicp/chapter_1/part_2/ex_1_12_test.clj index b75a321..4b20506 100644 --- a/test/sicp/chapter_1/ex_1_12_test.clj +++ b/test/sicp/chapter_1/part_2/ex_1_12_test.clj @@ -1,6 +1,6 @@ -(ns sicp.chapter-1.ex-1-12-test +(ns sicp.chapter-1.part_2.ex-1-12-test (:require [clojure.test :refer :all] - [sicp.chapter-1.ex-1-12 :refer [pascal]])) + [sicp.chapter-1.part_2.ex-1-12 :refer [pascal]])) (deftest pascal-test (is (= 1 (pascal 1 1))) diff --git a/test/sicp/chapter_1/ex_1_14_test.clj b/test/sicp/chapter_1/part_2/ex_1_14_test.clj similarity index 60% rename from test/sicp/chapter_1/ex_1_14_test.clj rename to test/sicp/chapter_1/part_2/ex_1_14_test.clj index 7090c2d..830bb16 100644 --- a/test/sicp/chapter_1/ex_1_14_test.clj +++ b/test/sicp/chapter_1/part_2/ex_1_14_test.clj @@ -1,6 +1,6 @@ -(ns sicp.chapter-1.ex-1-14-test +(ns sicp.chapter-1.part_2.ex-1-14-test (:require [clojure.test :refer :all] - [sicp.chapter-1.ex-1-14 :refer [money-change]])) + [sicp.chapter-1.part_2.ex-1-14 :refer [money-change]])) (deftest count-change-test (is (= 1 (money-change 1))) diff --git a/test/sicp/chapter_1/ex_1_15_test.clj b/test/sicp/chapter_1/part_2/ex_1_15_test.clj similarity index 59% rename from test/sicp/chapter_1/ex_1_15_test.clj rename to test/sicp/chapter_1/part_2/ex_1_15_test.clj index 15e929a..0267568 100644 --- a/test/sicp/chapter_1/ex_1_15_test.clj +++ b/test/sicp/chapter_1/part_2/ex_1_15_test.clj @@ -1,6 +1,6 @@ -(ns sicp.chapter-1.ex_1_15-test +(ns sicp.chapter-1.part_2.ex_1_15-test (:require [clojure.test :refer :all] - [sicp.chapter-1.ex_1_15 :refer [sine]])) + [sicp.chapter-1.part_2.ex_1_15 :refer [sine]])) (deftest sine-test (is (= -0.39980345741334 (sine 12.15))) ; 5 times, O(log3(n)) diff --git a/test/sicp/chapter_1/ex_1_16_test.clj b/test/sicp/chapter_1/part_2/ex_1_16_test.clj similarity index 54% rename from test/sicp/chapter_1/ex_1_16_test.clj rename to test/sicp/chapter_1/part_2/ex_1_16_test.clj index 1459308..581788c 100644 --- a/test/sicp/chapter_1/ex_1_16_test.clj +++ b/test/sicp/chapter_1/part_2/ex_1_16_test.clj @@ -1,6 +1,6 @@ -(ns sicp.chapter-1.ex-1-16-test +(ns sicp.chapter-1.part_2.ex-1-16-test (:require [clojure.test :refer :all] - [sicp.chapter-1.ex-1-16 :refer [expt]])) + [sicp.chapter-1.part_2.ex-1-16 :refer [expt]])) (deftest expt-test (is (= 1 (expt 1 2))) diff --git a/test/sicp/chapter_1/ex_1_17_test.clj b/test/sicp/chapter_1/part_2/ex_1_17_test.clj similarity index 86% rename from test/sicp/chapter_1/ex_1_17_test.clj rename to test/sicp/chapter_1/part_2/ex_1_17_test.clj index 87b307e..2281ae8 100644 --- a/test/sicp/chapter_1/ex_1_17_test.clj +++ b/test/sicp/chapter_1/part_2/ex_1_17_test.clj @@ -1,6 +1,6 @@ -(ns sicp.chapter-1.ex-1-17-test +(ns sicp.chapter-1.part_2.ex-1-17-test (:require [clojure.test :refer :all] - [sicp.chapter-1.ex-1-17 :refer [multi multi-fast]])) + [sicp.chapter-1.part_2.ex-1-17 :refer [multi multi-fast]])) (deftest multi-test (time (is (= 2 (multi 1 2)))) ; "Elapsed time: 2.383128 msecs" diff --git a/test/sicp/chapter_1/part_2/ex_1_18_test.clj b/test/sicp/chapter_1/part_2/ex_1_18_test.clj new file mode 100644 index 0000000..2c6bcb7 --- /dev/null +++ b/test/sicp/chapter_1/part_2/ex_1_18_test.clj @@ -0,0 +1,6 @@ +(ns sicp.chapter-1.part_2.ex-1-18-test + (:require [clojure.test :refer :all]) + (:require [sicp.chapter-1.part_2.ex-1-18 :refer [mult]])) + +(deftest mult-test + (is (= 0 (mult 0 19)))) diff --git a/test/sicp/chapter_1/ex_1_19_test.clj b/test/sicp/chapter_1/part_2/ex_1_19_test.clj similarity index 70% rename from test/sicp/chapter_1/ex_1_19_test.clj rename to test/sicp/chapter_1/part_2/ex_1_19_test.clj index 5247aed..5994c44 100644 --- a/test/sicp/chapter_1/ex_1_19_test.clj +++ b/test/sicp/chapter_1/part_2/ex_1_19_test.clj @@ -1,6 +1,6 @@ -(ns sicp.chapter-1.ex-1-19-test +(ns sicp.chapter-1.part_2.ex-1-19-test (:require [clojure.test :refer :all] - [sicp.chapter-1.ex-1-19 :refer [fib fib-v2]])) + [sicp.chapter-1.part_2.ex-1-19 :refer [fib fib-v2]])) (deftest fib-test (is (= 1 (fib 1))) diff --git a/test/sicp/chapter_1/ex_1_20_test.clj b/test/sicp/chapter_1/part_2/ex_1_20_test.clj similarity index 57% rename from test/sicp/chapter_1/ex_1_20_test.clj rename to test/sicp/chapter_1/part_2/ex_1_20_test.clj index ffe66d9..503839b 100644 --- a/test/sicp/chapter_1/ex_1_20_test.clj +++ b/test/sicp/chapter_1/part_2/ex_1_20_test.clj @@ -1,6 +1,6 @@ -(ns sicp.chapter-1.ex-1-20-test +(ns sicp.chapter-1.part_2.ex-1-20-test (:require [clojure.test :refer :all]) - (:require [sicp.chapter-1.ex-1-20 :refer [gcd]])) + (:require [sicp.chapter-1.part_2.ex-1-20 :refer [gcd]])) (deftest gcd-test (is (= 2 (gcd 206 40))) ; 4 times diff --git a/test/sicp/chapter_1/ex_1_21_test.clj b/test/sicp/chapter_1/part_2/ex_1_21_test.clj similarity index 63% rename from test/sicp/chapter_1/ex_1_21_test.clj rename to test/sicp/chapter_1/part_2/ex_1_21_test.clj index df076ba..336fa28 100644 --- a/test/sicp/chapter_1/ex_1_21_test.clj +++ b/test/sicp/chapter_1/part_2/ex_1_21_test.clj @@ -1,6 +1,6 @@ -(ns sicp.chapter-1.ex-1-21-test +(ns sicp.chapter-1.part_2.ex-1-21-test (:require [clojure.test :refer :all]) - (:require [sicp.chapter-1.ex-1-21 :refer [smallest-divisor]])) + (:require [sicp.chapter-1.part_2.ex-1-21 :refer [smallest-divisor]])) (deftest smallest-divisor-test (is (= 199 (smallest-divisor 199))) diff --git a/test/sicp/chapter_1/ex_1_22_test.clj b/test/sicp/chapter_1/part_2/ex_1_22_test.clj similarity index 60% rename from test/sicp/chapter_1/ex_1_22_test.clj rename to test/sicp/chapter_1/part_2/ex_1_22_test.clj index b47c1f4..a7696c9 100644 --- a/test/sicp/chapter_1/ex_1_22_test.clj +++ b/test/sicp/chapter_1/part_2/ex_1_22_test.clj @@ -1,6 +1,6 @@ -(ns sicp.chapter-1.ex-1-22-test +(ns sicp.chapter-1.part_2.ex-1-22-test (:require [clojure.test :refer :all]) - (:require [sicp.chapter-1.ex-1-22 :refer [find-primes]])) + (:require [sicp.chapter-1.part_2.ex-1-22 :refer [find-primes]])) (deftest find-primes-test (is (= 5 (find-primes 1 5)))) ; Change arguments and see the output diff --git a/test/sicp/chapter_1/ex_1_9_test.clj b/test/sicp/chapter_1/part_2/ex_1_9_test.clj similarity index 56% rename from test/sicp/chapter_1/ex_1_9_test.clj rename to test/sicp/chapter_1/part_2/ex_1_9_test.clj index 665c410..7a15faf 100644 --- a/test/sicp/chapter_1/ex_1_9_test.clj +++ b/test/sicp/chapter_1/part_2/ex_1_9_test.clj @@ -1,6 +1,6 @@ -(ns sicp.chapter-1.ex-1-9-test +(ns sicp.chapter-1.part_2.ex-1-9-test (:require [clojure.test :refer :all] - [sicp.chapter-1.ex-1-9 :refer [plus plus-v2]])) + [sicp.chapter-1.part_2.ex-1-9 :refer [plus plus-v2]])) (deftest plus-test (is (= 3 (plus 1 2))))