From 3ac8c8ee42b9780f39d59858d4fdd086a94fd937 Mon Sep 17 00:00:00 2001 From: Erik Schierboom Date: Sun, 14 Jul 2019 11:20:40 +0200 Subject: [PATCH 01/14] resistor-color-trio: add exercise --- .../resistor-color-trio/canonical-data.json | 46 +++++++++++++++++++ exercises/resistor-color-trio/description.md | 43 +++++++++++++++++ exercises/resistor-color-trio/metadata.yml | 4 ++ 3 files changed, 93 insertions(+) create mode 100644 exercises/resistor-color-trio/canonical-data.json create mode 100644 exercises/resistor-color-trio/description.md create mode 100644 exercises/resistor-color-trio/metadata.yml diff --git a/exercises/resistor-color-trio/canonical-data.json b/exercises/resistor-color-trio/canonical-data.json new file mode 100644 index 0000000000..4b850c8a79 --- /dev/null +++ b/exercises/resistor-color-trio/canonical-data.json @@ -0,0 +1,46 @@ +{ + "exercise": "resistor-color-trio", + "version": "1.0.0", + "cases": [ + { + "description": "Orange and orange and black", + "property": "description", + "input": { + "colors": ["orange", "orange", "black"] + }, + "expected": "The value of this resistor is 33 Ohms." + }, + { + "description": "Blue and grey and brown", + "property": "description", + "input": { + "colors": ["blue", "grey", "brown"] + }, + "expected": "The value of this resistor is 680 Ohms." + }, + { + "description": "Red and black and red", + "property": "description", + "input": { + "colors": ["red", "black", "red"] + }, + "expected": "The value of this resistor is 2 kOhms." + }, + { + "description": "Green and brown and orange", + "property": "description", + "input": { + "colors": ["green", "brown", "orange"] + }, + "expected": "The value of this resistor is 51 kOhms." + }, + { + "description": "Yellow and violet and yellow", + "property": "description", + "input": { + "colors": ["yellow", "violet", "yellow"] + }, + "expected": "The value of this resistor is 470 kOhms." + } + ] +} diff --git a/exercises/resistor-color-trio/description.md b/exercises/resistor-color-trio/description.md new file mode 100644 index 0000000000..2bebdd3429 --- /dev/null +++ b/exercises/resistor-color-trio/description.md @@ -0,0 +1,43 @@ +If you want to build something using a Raspberry Pi, you'll probably use _resistors_. For this exercise, you need to know only three things about them: + +- Each resistor has a resistance value. +- Resistors are small - so small in fact that if you printed the resistance value on them, it would be hard to read. + To get around this problem, manufacturers print color-coded bands onto the resistors to denote their resistance values. +- Each band acts as a digit of a number. For example, if they printed a brown band (value 1) followed by a green band (value 5), it would translate to the number 15. + In this exercise, you are going to create a helpful program so that you don't have to remember the values of the bands. The program will take 3 colors as input, and outputs the correct value, in Ohms. + The color bands are encoded as follows: + +* Black: 0 +* Brown: 1 +* Red: 2 +* Orange: 3 +* Yellow: 4 +* Green: 5 +* Blue: 6 +* Violet: 7 +* Grey: 8 +* White: 9 + +In `resistor-color duo` you decoded the first two colors. For instance: orange-orange got the main value `33`. +The third color stands for how many zeros need to be added to the main value. The main value plus the zeros gives us a value in Ohms. +For the exercise it doesn't matter what Ohms really are. +For example: + +- orange-orange-black would be 33 and no zeros, which becomes 33 Ohms. +- orange-orange-red would be 33 and 2 zeros, which becomes 3300 Ohms. +- orange-orange-orange would be 33 and 3 zeros, which becomes 33000 Ohms. + +(If Math is your thing, you may want to think of the zeros as exponents of 10. If Math is not your thing, go with the zeros. It really is the same thing, just in plain English instead of Math lingo.) + +This exercise is about translating the colors into a sentence: + +> "The value of this resistor is … Ohms." + +So an input of `“orange”, “orange”, “black”` should return + +> “The value of this resistor is 33 Ohms.” + +The trick is that when we talk about Ohms, as soon as we get more than a thousand, we say “kilo”, in the same way that we say “kilograms” (kg) and “kilometers” (km). In the same way, we get “kilo-ohms” (kOhms). +So an input of `"orange", "orange", "orange"` should return + +> "The value of this resistor is 33 kOhms." diff --git a/exercises/resistor-color-trio/metadata.yml b/exercises/resistor-color-trio/metadata.yml new file mode 100644 index 0000000000..46614cd61a --- /dev/null +++ b/exercises/resistor-color-trio/metadata.yml @@ -0,0 +1,4 @@ +--- +blurb: "Convert color codes, as used on resistors, to a human-readable string." +source: "Maud de Vries, Erik Schierboom" +source_url: "https://github.com/exercism/problem-specifications/issues/1549" From 53704f5057dda96007def01ee8bf3e174de057c5 Mon Sep 17 00:00:00 2001 From: Erik Schierboom Date: Tue, 16 Jul 2019 08:05:28 +0200 Subject: [PATCH 02/14] Update exercises/resistor-color-trio/description.md Co-Authored-By: Maud de Vries --- exercises/resistor-color-trio/description.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/resistor-color-trio/description.md b/exercises/resistor-color-trio/description.md index 2bebdd3429..d32caa5045 100644 --- a/exercises/resistor-color-trio/description.md +++ b/exercises/resistor-color-trio/description.md @@ -37,7 +37,7 @@ So an input of `“orange”, “orange”, “black”` should return > “The value of this resistor is 33 Ohms.” -The trick is that when we talk about Ohms, as soon as we get more than a thousand, we say “kilo”, in the same way that we say “kilograms” (kg) and “kilometers” (km). In the same way, we get “kilo-ohms” (kOhms). +The trick is that when we talk about Ohms, as soon as we get more than a thousand, we say "kilo", in the same way that we say "kilograms" (kg) and "kilometers" (km). In the same way, we get "kilo-ohms" (kilo Ohms). So an input of `"orange", "orange", "orange"` should return > "The value of this resistor is 33 kOhms." From b0d6b4550e71c247dd60fbc0dc270ca0acb5bfbd Mon Sep 17 00:00:00 2001 From: Erik Schierboom Date: Tue, 16 Jul 2019 17:37:25 +0200 Subject: [PATCH 03/14] resistor-color-trio: use normal quotation marks --- exercises/resistor-color-trio/description.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/exercises/resistor-color-trio/description.md b/exercises/resistor-color-trio/description.md index d32caa5045..8f05310a86 100644 --- a/exercises/resistor-color-trio/description.md +++ b/exercises/resistor-color-trio/description.md @@ -33,9 +33,9 @@ This exercise is about translating the colors into a sentence: > "The value of this resistor is … Ohms." -So an input of `“orange”, “orange”, “black”` should return +So an input of `"orange”, "orange”, "black”` should return -> “The value of this resistor is 33 Ohms.” +> "The value of this resistor is 33 Ohms.” The trick is that when we talk about Ohms, as soon as we get more than a thousand, we say "kilo", in the same way that we say "kilograms" (kg) and "kilometers" (km). In the same way, we get "kilo-ohms" (kilo Ohms). So an input of `"orange", "orange", "orange"` should return From 25a7d233e18c298f5fd0d5059976ebbdf79035d7 Mon Sep 17 00:00:00 2001 From: Erik Schierboom Date: Tue, 16 Jul 2019 17:37:48 +0200 Subject: [PATCH 04/14] resistor-color-trio: use kilo ohms --- exercises/resistor-color-trio/canonical-data.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/exercises/resistor-color-trio/canonical-data.json b/exercises/resistor-color-trio/canonical-data.json index 4b850c8a79..d8af806edf 100644 --- a/exercises/resistor-color-trio/canonical-data.json +++ b/exercises/resistor-color-trio/canonical-data.json @@ -24,7 +24,7 @@ "input": { "colors": ["red", "black", "red"] }, - "expected": "The value of this resistor is 2 kOhms." + "expected": "The value of this resistor is 2 kilo Ohms." }, { "description": "Green and brown and orange", @@ -32,7 +32,7 @@ "input": { "colors": ["green", "brown", "orange"] }, - "expected": "The value of this resistor is 51 kOhms." + "expected": "The value of this resistor is 51 kilo Ohms." }, { "description": "Yellow and violet and yellow", @@ -40,7 +40,7 @@ "input": { "colors": ["yellow", "violet", "yellow"] }, - "expected": "The value of this resistor is 470 kOhms." + "expected": "The value of this resistor is 470 kilo Ohms." } ] } From 0a96e2b04880d54b48d1b1e74278cfe673e6b6df Mon Sep 17 00:00:00 2001 From: Erik Schierboom Date: Tue, 16 Jul 2019 17:39:34 +0200 Subject: [PATCH 05/14] resistor-color-trio: shorten description --- exercises/resistor-color-trio/canonical-data.json | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/exercises/resistor-color-trio/canonical-data.json b/exercises/resistor-color-trio/canonical-data.json index d8af806edf..bec949b3c5 100644 --- a/exercises/resistor-color-trio/canonical-data.json +++ b/exercises/resistor-color-trio/canonical-data.json @@ -8,7 +8,7 @@ "input": { "colors": ["orange", "orange", "black"] }, - "expected": "The value of this resistor is 33 Ohms." + "expected": "This is a 33 Ohms resistor." }, { "description": "Blue and grey and brown", @@ -16,7 +16,7 @@ "input": { "colors": ["blue", "grey", "brown"] }, - "expected": "The value of this resistor is 680 Ohms." + "expected": "This is a 680 Ohms resistor." }, { "description": "Red and black and red", @@ -24,7 +24,7 @@ "input": { "colors": ["red", "black", "red"] }, - "expected": "The value of this resistor is 2 kilo Ohms." + "expected": "This is a 2 kilo Ohms resistor." }, { "description": "Green and brown and orange", @@ -32,7 +32,7 @@ "input": { "colors": ["green", "brown", "orange"] }, - "expected": "The value of this resistor is 51 kilo Ohms." + "expected": "This is a 51 kilo Ohms resistor." }, { "description": "Yellow and violet and yellow", @@ -40,7 +40,7 @@ "input": { "colors": ["yellow", "violet", "yellow"] }, - "expected": "The value of this resistor is 470 kilo Ohms." + "expected": "This is a 470 kilo Ohms resistor." } ] } From a7104fa9179c4825b07b7926cd58f2d9ca86dce4 Mon Sep 17 00:00:00 2001 From: Erik Schierboom Date: Tue, 16 Jul 2019 17:55:11 +0200 Subject: [PATCH 06/14] resistor-color-trio: use two different properties --- .../resistor-color-trio/canonical-data.json | 32 ++++++++++++------- 1 file changed, 20 insertions(+), 12 deletions(-) diff --git a/exercises/resistor-color-trio/canonical-data.json b/exercises/resistor-color-trio/canonical-data.json index bec949b3c5..7a40e881bc 100644 --- a/exercises/resistor-color-trio/canonical-data.json +++ b/exercises/resistor-color-trio/canonical-data.json @@ -4,35 +4,43 @@ "cases": [ { "description": "Orange and orange and black", - "property": "description", + "property": "value", "input": { "colors": ["orange", "orange", "black"] }, - "expected": "This is a 33 Ohms resistor." + "expected": 33 }, { - "description": "Blue and grey and brown", - "property": "description", + "description": "Green and brown and brown", + "property": "value", "input": { - "colors": ["blue", "grey", "brown"] + "colors": ["green", "brown", "orange"] }, - "expected": "This is a 680 Ohms resistor." + "expected": 510 }, { - "description": "Red and black and red", + "description": "Blue and grey and yellow", + "property": "value", + "input": { + "colors": ["blue", "grey", "yellow"] + }, + "expected": 680000 + }, + { + "description": "Brown and black and black", "property": "description", "input": { - "colors": ["red", "black", "red"] + "colors": ["brown", "black", "black"] }, - "expected": "This is a 2 kilo Ohms resistor." + "expected": "This is a 1O Ohms resistor." }, { - "description": "Green and brown and orange", + "description": "Red and black and red", "property": "description", "input": { - "colors": ["green", "brown", "orange"] + "colors": ["red", "black", "red"] }, - "expected": "This is a 51 kilo Ohms resistor." + "expected": "This is a 2 kilo Ohms resistor." }, { "description": "Yellow and violet and yellow", From 9cc8e6196b9c2b24ca4b9737c7537591af9a90fb Mon Sep 17 00:00:00 2001 From: Erik Schierboom Date: Tue, 16 Jul 2019 18:26:37 +0200 Subject: [PATCH 07/14] resistor-color-trio: more unicode character fixes --- exercises/resistor-color-trio/description.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/exercises/resistor-color-trio/description.md b/exercises/resistor-color-trio/description.md index 8f05310a86..e7524f2a79 100644 --- a/exercises/resistor-color-trio/description.md +++ b/exercises/resistor-color-trio/description.md @@ -33,11 +33,11 @@ This exercise is about translating the colors into a sentence: > "The value of this resistor is … Ohms." -So an input of `"orange”, "orange”, "black”` should return +So an input of `"orange", "orange", "black"` should return: -> "The value of this resistor is 33 Ohms.” +> "The value of this resistor is 33 Ohms." The trick is that when we talk about Ohms, as soon as we get more than a thousand, we say "kilo", in the same way that we say "kilograms" (kg) and "kilometers" (km). In the same way, we get "kilo-ohms" (kilo Ohms). -So an input of `"orange", "orange", "orange"` should return +So an input of `"orange", "orange", "orange"` should return: > "The value of this resistor is 33 kOhms." From d2f19d010799f09e82b3c07fe093a3be7fa232dd Mon Sep 17 00:00:00 2001 From: Erik Schierboom Date: Thu, 18 Jul 2019 08:21:23 +0200 Subject: [PATCH 08/14] resistor-color-trio: move to label property --- .../resistor-color-trio/canonical-data.json | 40 ++++++++----------- 1 file changed, 16 insertions(+), 24 deletions(-) diff --git a/exercises/resistor-color-trio/canonical-data.json b/exercises/resistor-color-trio/canonical-data.json index 7a40e881bc..eac2b545cc 100644 --- a/exercises/resistor-color-trio/canonical-data.json +++ b/exercises/resistor-color-trio/canonical-data.json @@ -4,51 +4,43 @@ "cases": [ { "description": "Orange and orange and black", - "property": "value", + "property": "label", "input": { "colors": ["orange", "orange", "black"] }, - "expected": 33 + "expected": "33 Ohms" }, { - "description": "Green and brown and brown", - "property": "value", + "description": "Blue and grey and brown", + "property": "label", "input": { - "colors": ["green", "brown", "orange"] - }, - "expected": 510 - }, - { - "description": "Blue and grey and yellow", - "property": "value", - "input": { - "colors": ["blue", "grey", "yellow"] + "colors": ["blue", "grey", "brown"] }, - "expected": 680000 + "expected": "680 Ohms" }, { - "description": "Brown and black and black", - "property": "description", + "description": "Red and black and red", + "property": "label", "input": { - "colors": ["brown", "black", "black"] + "colors": ["red", "black", "red"] }, - "expected": "This is a 1O Ohms resistor." + "expected": "2 kilo Ohms" }, { - "description": "Red and black and red", - "property": "description", + "description": "Green and brown and orange", + "property": "label", "input": { - "colors": ["red", "black", "red"] + "colors": ["green", "brown", "orange"] }, - "expected": "This is a 2 kilo Ohms resistor." + "expected": "51 kilo Ohms" }, { "description": "Yellow and violet and yellow", - "property": "description", + "property": "label", "input": { "colors": ["yellow", "violet", "yellow"] }, - "expected": "This is a 470 kilo Ohms resistor." + "expected": "470 kilo Ohms" } ] } From 3f7032de174f16b6cce5fdf0e6d0c5a313bdb23b Mon Sep 17 00:00:00 2001 From: Erik Schierboom Date: Thu, 18 Jul 2019 08:22:53 +0200 Subject: [PATCH 09/14] Update exercises/resistor-color-trio/description.md Co-Authored-By: Maud de Vries --- exercises/resistor-color-trio/description.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/resistor-color-trio/description.md b/exercises/resistor-color-trio/description.md index e7524f2a79..5a3e56029f 100644 --- a/exercises/resistor-color-trio/description.md +++ b/exercises/resistor-color-trio/description.md @@ -31,7 +31,7 @@ For example: This exercise is about translating the colors into a sentence: -> "The value of this resistor is … Ohms." +> "The value of this resistor is ... Ohms." So an input of `"orange", "orange", "black"` should return: From df1109ffd8f9288214c0aac62e9b2984491f9a50 Mon Sep 17 00:00:00 2001 From: Erik Schierboom Date: Thu, 18 Jul 2019 08:23:04 +0200 Subject: [PATCH 10/14] Update exercises/resistor-color-trio/description.md Co-Authored-By: Maud de Vries --- exercises/resistor-color-trio/description.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/resistor-color-trio/description.md b/exercises/resistor-color-trio/description.md index 5a3e56029f..42aeaf8fc7 100644 --- a/exercises/resistor-color-trio/description.md +++ b/exercises/resistor-color-trio/description.md @@ -37,7 +37,7 @@ So an input of `"orange", "orange", "black"` should return: > "The value of this resistor is 33 Ohms." -The trick is that when we talk about Ohms, as soon as we get more than a thousand, we say "kilo", in the same way that we say "kilograms" (kg) and "kilometers" (km). In the same way, we get "kilo-ohms" (kilo Ohms). +When we get more than a thousand Ohms, we say "kilo Ohms". That's similar to saying "kilometer" for 1000 meters, and "kilograms" for 1000 grams. So an input of `"orange", "orange", "orange"` should return: > "The value of this resistor is 33 kOhms." From 3dd6a99f98cbb430ac0aed861be80e88bea35eac Mon Sep 17 00:00:00 2001 From: Erik Schierboom Date: Thu, 18 Jul 2019 17:36:44 +0200 Subject: [PATCH 11/14] resistor-color-trio: update expected labels to normalized format --- exercises/resistor-color-trio/canonical-data.json | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/exercises/resistor-color-trio/canonical-data.json b/exercises/resistor-color-trio/canonical-data.json index eac2b545cc..54e84bf5d9 100644 --- a/exercises/resistor-color-trio/canonical-data.json +++ b/exercises/resistor-color-trio/canonical-data.json @@ -8,7 +8,7 @@ "input": { "colors": ["orange", "orange", "black"] }, - "expected": "33 Ohms" + "expected": "33 ohms" }, { "description": "Blue and grey and brown", @@ -16,7 +16,7 @@ "input": { "colors": ["blue", "grey", "brown"] }, - "expected": "680 Ohms" + "expected": "680 ohms" }, { "description": "Red and black and red", @@ -24,7 +24,7 @@ "input": { "colors": ["red", "black", "red"] }, - "expected": "2 kilo Ohms" + "expected": "2 kiloohms" }, { "description": "Green and brown and orange", @@ -32,7 +32,7 @@ "input": { "colors": ["green", "brown", "orange"] }, - "expected": "51 kilo Ohms" + "expected": "51 kiloohms" }, { "description": "Yellow and violet and yellow", @@ -40,7 +40,7 @@ "input": { "colors": ["yellow", "violet", "yellow"] }, - "expected": "470 kilo Ohms" + "expected": "470 kiloohms" } ] } From 5a50a7b2e7aeace7a789040ed1dc916c8c36035b Mon Sep 17 00:00:00 2001 From: Erik Schierboom Date: Fri, 19 Jul 2019 08:14:44 +0200 Subject: [PATCH 12/14] resistor-color-trio: update blurb --- exercises/resistor-color-trio/metadata.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/resistor-color-trio/metadata.yml b/exercises/resistor-color-trio/metadata.yml index 46614cd61a..de7ab1c5c9 100644 --- a/exercises/resistor-color-trio/metadata.yml +++ b/exercises/resistor-color-trio/metadata.yml @@ -1,4 +1,4 @@ --- -blurb: "Convert color codes, as used on resistors, to a human-readable string." +blurb: "Convert color codes, as used on resistors, to a human-readable label." source: "Maud de Vries, Erik Schierboom" source_url: "https://github.com/exercism/problem-specifications/issues/1549" From 3d23cd942aa7d3e8d017dc83083fd485c51f7f7e Mon Sep 17 00:00:00 2001 From: Erik Schierboom Date: Fri, 19 Jul 2019 08:18:28 +0200 Subject: [PATCH 13/14] resistor-color-trio: change Ohms to ohms --- exercises/resistor-color-trio/description.md | 22 ++++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/exercises/resistor-color-trio/description.md b/exercises/resistor-color-trio/description.md index 42aeaf8fc7..a0ac2652a2 100644 --- a/exercises/resistor-color-trio/description.md +++ b/exercises/resistor-color-trio/description.md @@ -4,7 +4,7 @@ If you want to build something using a Raspberry Pi, you'll probably use _resist - Resistors are small - so small in fact that if you printed the resistance value on them, it would be hard to read. To get around this problem, manufacturers print color-coded bands onto the resistors to denote their resistance values. - Each band acts as a digit of a number. For example, if they printed a brown band (value 1) followed by a green band (value 5), it would translate to the number 15. - In this exercise, you are going to create a helpful program so that you don't have to remember the values of the bands. The program will take 3 colors as input, and outputs the correct value, in Ohms. + In this exercise, you are going to create a helpful program so that you don't have to remember the values of the bands. The program will take 3 colors as input, and outputs the correct value, in ohms. The color bands are encoded as follows: * Black: 0 @@ -19,25 +19,25 @@ If you want to build something using a Raspberry Pi, you'll probably use _resist * White: 9 In `resistor-color duo` you decoded the first two colors. For instance: orange-orange got the main value `33`. -The third color stands for how many zeros need to be added to the main value. The main value plus the zeros gives us a value in Ohms. -For the exercise it doesn't matter what Ohms really are. +The third color stands for how many zeros need to be added to the main value. The main value plus the zeros gives us a value in ohms. +For the exercise it doesn't matter what ohms really are. For example: -- orange-orange-black would be 33 and no zeros, which becomes 33 Ohms. -- orange-orange-red would be 33 and 2 zeros, which becomes 3300 Ohms. -- orange-orange-orange would be 33 and 3 zeros, which becomes 33000 Ohms. +- orange-orange-black would be 33 and no zeros, which becomes 33 ohms. +- orange-orange-red would be 33 and 2 zeros, which becomes 3300 ohms. +- orange-orange-orange would be 33 and 3 zeros, which becomes 33000 ohms. (If Math is your thing, you may want to think of the zeros as exponents of 10. If Math is not your thing, go with the zeros. It really is the same thing, just in plain English instead of Math lingo.) -This exercise is about translating the colors into a sentence: +This exercise is about translating the colors into a label: -> "The value of this resistor is ... Ohms." +> "... ohms" So an input of `"orange", "orange", "black"` should return: -> "The value of this resistor is 33 Ohms." +> "33 ohms" -When we get more than a thousand Ohms, we say "kilo Ohms". That's similar to saying "kilometer" for 1000 meters, and "kilograms" for 1000 grams. +When we get more than a thousand ohms, we say "kiloohms". That's similar to saying "kilometer" for 1000 meters, and "kilograms" for 1000 grams. So an input of `"orange", "orange", "orange"` should return: -> "The value of this resistor is 33 kOhms." +> "33 kiloohms" From dca9af36d2a5d82fdafe7910a02650716c8b2dc4 Mon Sep 17 00:00:00 2001 From: Erik Schierboom Date: Wed, 24 Jul 2019 17:05:00 +0200 Subject: [PATCH 14/14] resistor-color-trio: change expected format --- .../resistor-color-trio/canonical-data.json | 25 +++++++++++++++---- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/exercises/resistor-color-trio/canonical-data.json b/exercises/resistor-color-trio/canonical-data.json index 54e84bf5d9..9b4a60d7a6 100644 --- a/exercises/resistor-color-trio/canonical-data.json +++ b/exercises/resistor-color-trio/canonical-data.json @@ -8,7 +8,10 @@ "input": { "colors": ["orange", "orange", "black"] }, - "expected": "33 ohms" + "expected": { + "value": 33, + "unit": "ohms" + } }, { "description": "Blue and grey and brown", @@ -16,7 +19,10 @@ "input": { "colors": ["blue", "grey", "brown"] }, - "expected": "680 ohms" + "expected": { + "value": 680, + "unit": "ohms" + } }, { "description": "Red and black and red", @@ -24,7 +30,10 @@ "input": { "colors": ["red", "black", "red"] }, - "expected": "2 kiloohms" + "expected": { + "value": 2, + "unit": "kiloohms" + } }, { "description": "Green and brown and orange", @@ -32,7 +41,10 @@ "input": { "colors": ["green", "brown", "orange"] }, - "expected": "51 kiloohms" + "expected": { + "value": 51, + "unit": "kiloohms" + } }, { "description": "Yellow and violet and yellow", @@ -40,7 +52,10 @@ "input": { "colors": ["yellow", "violet", "yellow"] }, - "expected": "470 kiloohms" + "expected": { + "value": 470, + "unit": "kiloohms" + } } ] }