Skip to content

Commit 39cb284

Browse files
Update resistor_color_duo.clj
Co-authored-by: Anastasios Chatzialexiou <[email protected]>
1 parent 63e89f7 commit 39cb284

File tree

4 files changed

+10
-10
lines changed

4 files changed

+10
-10
lines changed

exercises/practice/resistor-color-duo/.meta/example.clj

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
(defn- color-code [color] (.indexOf colors color))
66

7-
(defn value
7+
(defn resistor-value
88
"Returns the resistor value based on the given colors"
99
[[color-1 color-2]]
1010
(+ (* 10 (color-code color-1)) (color-code color-2)))

exercises/practice/resistor-color-duo/.meta/generator.tpl

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@
44
{{#test_cases.value}}
55
(deftest value_test_{{idx}}
66
(testing {{description}}
7-
(is (= {{expected}} (resistor-color-duo/value {{input.colors}})))))
7+
(is (= {{expected}} (resistor-color-duo/resistor-value {{input.colors}})))))
88
{{/test_cases.value~}}

exercises/practice/resistor-color-duo/src/resistor_color_duo.clj

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
(ns resistor-color-duo)
22

3-
(defn value
3+
(defn resistor-value
44
"Returns the resistor value based on the given colors"
55
[colors]
66
;; function body

exercises/practice/resistor-color-duo/test/resistor_color_duo_test.clj

+7-7
Original file line numberDiff line numberDiff line change
@@ -4,28 +4,28 @@
44

55
(deftest value_test_1
66
(testing "Brown and black"
7-
(is (= 10 (resistor-color-duo/value ["brown" "black"])))))
7+
(is (= 10 (resistor-color-duo/resistor-value ["brown" "black"])))))
88

99
(deftest value_test_2
1010
(testing "Blue and grey"
11-
(is (= 68 (resistor-color-duo/value ["blue" "grey"])))))
11+
(is (= 68 (resistor-color-duo/resistor-value ["blue" "grey"])))))
1212

1313
(deftest value_test_3
1414
(testing "Yellow and violet"
15-
(is (= 47 (resistor-color-duo/value ["yellow" "violet"])))))
15+
(is (= 47 (resistor-color-duo/resistor-value ["yellow" "violet"])))))
1616

1717
(deftest value_test_4
1818
(testing "White and red"
19-
(is (= 92 (resistor-color-duo/value ["white" "red"])))))
19+
(is (= 92 (resistor-color-duo/resistor-value ["white" "red"])))))
2020

2121
(deftest value_test_5
2222
(testing "Orange and orange"
23-
(is (= 33 (resistor-color-duo/value ["orange" "orange"])))))
23+
(is (= 33 (resistor-color-duo/resistor-value ["orange" "orange"])))))
2424

2525
(deftest value_test_6
2626
(testing "Ignore additional colors"
27-
(is (= 51 (resistor-color-duo/value ["green" "brown" "orange"])))))
27+
(is (= 51 (resistor-color-duo/resistor-value ["green" "brown" "orange"])))))
2828

2929
(deftest value_test_7
3030
(testing "Black and brown, one-digit"
31-
(is (= 1 (resistor-color-duo/value ["black" "brown"])))))
31+
(is (= 1 (resistor-color-duo/resistor-value ["black" "brown"])))))

0 commit comments

Comments
 (0)