From dc1738d82524b9f465070c2084cf498058517bf7 Mon Sep 17 00:00:00 2001 From: Cool-Katt Date: Tue, 8 Sep 2026 14:22:40 +0300 Subject: [PATCH 01/12] Initial commit --- .../resistor-color-expert/canonical-data.json | 161 ++++++++++++++++++ .../resistor-color-expert/description.md | 82 +++++++++ exercises/resistor-color-expert/metadata.toml | 4 + 3 files changed, 247 insertions(+) create mode 100644 exercises/resistor-color-expert/canonical-data.json create mode 100644 exercises/resistor-color-expert/description.md create mode 100644 exercises/resistor-color-expert/metadata.toml diff --git a/exercises/resistor-color-expert/canonical-data.json b/exercises/resistor-color-expert/canonical-data.json new file mode 100644 index 0000000000..c55d448f47 --- /dev/null +++ b/exercises/resistor-color-expert/canonical-data.json @@ -0,0 +1,161 @@ +{ + "exercise": "resistor-color-expert", + "cases": [ + { + "uuid": "fb677832-9a1b-4493-a5b0-786db5a8479c", + "description": "Orange, orange, black and red", + "property": "labelDecoder", + "input": { + "colors": ["orange", "orange", "black", "red"] + }, + "expected": { + "value": 33, + "unit": "ohms", + "tolerance":"±2%", + } + }, + { + "uuid": "8bdeb354-b8cf-47c1-96e4-84dceda90f8c", + "description": "Blue, gray, brown and violet", + "property": "labelDecoder", + "input": { + "colors": ["blue", "grey", "brown", "violet"] + }, + "expected": { + "value": 680, + "unit": "ohms", + "tolerance":"±0.1%", + } + }, + { + "uuid": "b4ef8864-09fc-443b-b4fb-82835c081637", + "description": "Red, black, red and green", + "property": "labelDecoder", + "input": { + "colors": ["red", "black", "red", "green"] + }, + "expected": { + "value": 2, + "unit": "kiloohms", + "tolerance":"±0.5%", + } + }, + { + "uuid": "c001757b-d388-4f42-9987-23e42bc22d68", + "description": "Green, brownm orange and grey", + "property": "labelDecoder", + "input": { + "colors": ["green", "brown", "orange", "grey"] + }, + "expected": { + "value": 51, + "unit": "kiloohms", + "tolerance":"±0.5%", + } + }, + { + "uuid": "1cb18e15-1fc5-4375-8a24-ca6eee130a27", + "description": "Only one band", + "comments":["One band resistors only have the color black with a value of 0 and no tolerance."], + "property": "labelDecoder", + "input": { + "colors": ["black"] + }, + "expected": { + "value": 0, + "unit": "ohms", + } + }, + { + "uuid": "7e6841b9-0d11-43fb-85ad-be50e49b0656", + "description": "Orange, orange, yellow, black and brown", + "property": "labelDecoder", + "input": { + "colors": ["orange", "orange", "yellow", "black", "brown"] + }, + "expected": { + "value": 334, + "unit": "ohms", + "tolerance":"±1%", + } + }, + { + "uuid": "00019463-44d1-47f5-b59f-f3e7defc03d9", + "description": "Red, green, yellow, yellow and brown", + "property": "labelDecoder", + "input": { + "colors": ["red", "green", "yellow", "yellow", "brown"] + }, + "expected": { + "value": 2.54, + "unit": "megaohms", + "tolerance":"±1%", + } + }, + { + "uuid": "7998837e-fdfa-48c6-9191-0ab27c4777cc", + "description": "Blue, gray, white, brown and brown", + "property": "labelDecoder", + "input": { + "colors": ["blue", "grey", "white", "brown", "brown"] + }, + "expected": { + "value": 6.89, + "unit": "kiloohms", + "tolerance":"±1%", + } + }, + { + "uuid": "51554e9f-c21d-4a73-a54c-1d9a973eaed0", + "description": "Violet, orange, red and gray", + "property": "labelDecoder", + "input": { + "colors": ["violet", "orange", "red", "grey"] + }, + "expected": { + "value": 7.3, + "unit": "kiloohms", + "tolerance":"±0.05%", + } + }, + { + "uuid": "68aa7ba3-2334-411a-b3a4-7c47fe20fd99", + "description": "Brown, red, orange, green and blue", + "property": "labelDecoder", + "input": { + "colors": ["brown", "red", "orange", "green", "blue"] + }, + "expected": { + "value": 12.3, + "unit": "megaohms", + "tolerance":"±0.25%", + } + }, + { + "uuid": "f6069edc-099b-429b-b2a9-bbe2537d2fae", + "description": "Brown, black, brown, yellow and violet", + "property": "labelDecoder", + "input": { + "colors": ["brown", "black", "brown", "yellow", "violet"] + }, + "expected": { + "value": 1.01, + "unit": "megaohms", + "tolerance":"±0.1%", + } + }, + { + "uuid": "8fce56df-326e-45fe-9265-b69c334b9023", + "description": "Brown, black, red and red", + "property": "labelDecoder", + "input": { + "colors": ["brown", "black", "red", "red"] + }, + "expected": { + "value": 1, + "unit": "kiloohms", + "tolerance":"±2%", + } + } + ] +} diff --git a/exercises/resistor-color-expert/description.md b/exercises/resistor-color-expert/description.md new file mode 100644 index 0000000000..0b4a71f00a --- /dev/null +++ b/exercises/resistor-color-expert/description.md @@ -0,0 +1,82 @@ +# Description + +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 1, 4, or 5 colors as input and output 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 Trio`][resistor-color-trio-exercise] you decoded the first three color bands. +For instance: orange-orange-brown translated to the main value `330`. +In this exercise you will need to add _tolerance_ to the mix. +Tolerance is the maximum amount that a value can be above or below the main value. +For example, if the last band is green, the maximum tolerance will be `±0.5%`. + +The tolerance band will have one of these values: + +- grey - 0.05% +- violet - 0.1% +- blue - 0.25% +- green - 0.5% +- brown - 1% +- red - 2% +- gold - 5% +- silver - 10% + +The four-band resistor is built up like this: + +| Band_1 | Band_2 | Band_3 | Band_4 | +| ------- | ------- | ---------- | --------- | +| Value_1 | Value_2 | Multiplier | Tolerance | + +Examples: + +- orange-orange-brown-green would be `330` ohms with a `±0.5%` tolerance. +- orange-orange-red-grey would be `3300` ohms with a `±0.05%` tolerance. + +The difference between a four and five-band resistor is that the five-band resistor has an extra band to indicate a more precise value. + +| Band_1 | Band_2 | Band_3 | Band_4 | Band_5 | +| ------- | ------- | ------- | ---------- | --------- | +| Value_1 | Value_2 | Value_3 | Multiplier | Tolerance | + +Examples: + +- orange-orange-orange-black-green would be `333` ohms with a `±0.5%` tolerance. +- orange-red-orange-blue-violet would be `323 million` ohms with a `±0.1%` tolerance. + +There are also one band resistors. +One band resistors only have the color black with a value of 0. + + +Your program should translate an input `list` of resistor band colors into a label: + +"... ohms ±...%" + +So an input `list` of `["orange", "orange", "black", "green"]` should return: + +"33 ohms ±0.5%" + +When there are thousands of ohms, we say "kiloohms". +That's similar to saying "kilometer" for 1000 meters, and "kilograms" for 1000 grams. + +So an input `list` of `["orange", "orange", "orange", "grey"]` should return: + +"33 kiloohms ±0.05%" + +When there are millions of ohms, we say "megaohms". + +So an input `list` of `["orange", "orange", "blue", "red"]` should return: + +"33 megaohms ±2%" + +[resistor-color-trio-exercise]: https://exercism.org/tracks/python/exercises/resistor-color-trio \ No newline at end of file diff --git a/exercises/resistor-color-expert/metadata.toml b/exercises/resistor-color-expert/metadata.toml new file mode 100644 index 0000000000..9fe36e62e7 --- /dev/null +++ b/exercises/resistor-color-expert/metadata.toml @@ -0,0 +1,4 @@ +title = "Resistor Color Expert" +blurb = "Convert color codes as used on resistors with different bands to a human-readable label." +source = "Ported for the Python Track" +source_url = "https://github.com/exercism/python/tree/main/exercises/practice/resistor-color-expert" From 3b69921e77e38a72ad2a1c5a5cd7626e3303fb88 Mon Sep 17 00:00:00 2001 From: Cool-Katt Date: Tue, 8 Sep 2026 14:44:44 +0300 Subject: [PATCH 02/12] Fixing my stupid trailing comma mistake --- .../resistor-color-expert/canonical-data.json | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/exercises/resistor-color-expert/canonical-data.json b/exercises/resistor-color-expert/canonical-data.json index c55d448f47..56ab175f86 100644 --- a/exercises/resistor-color-expert/canonical-data.json +++ b/exercises/resistor-color-expert/canonical-data.json @@ -11,7 +11,7 @@ "expected": { "value": 33, "unit": "ohms", - "tolerance":"±2%", + "tolerance":"±2%" } }, { @@ -24,7 +24,7 @@ "expected": { "value": 680, "unit": "ohms", - "tolerance":"±0.1%", + "tolerance":"±0.1%" } }, { @@ -37,7 +37,7 @@ "expected": { "value": 2, "unit": "kiloohms", - "tolerance":"±0.5%", + "tolerance":"±0.5%" } }, { @@ -50,7 +50,7 @@ "expected": { "value": 51, "unit": "kiloohms", - "tolerance":"±0.5%", + "tolerance":"±0.5%" } }, { @@ -63,7 +63,7 @@ }, "expected": { "value": 0, - "unit": "ohms", + "unit": "ohms" } }, { @@ -76,7 +76,7 @@ "expected": { "value": 334, "unit": "ohms", - "tolerance":"±1%", + "tolerance":"±1%" } }, { @@ -89,7 +89,7 @@ "expected": { "value": 2.54, "unit": "megaohms", - "tolerance":"±1%", + "tolerance":"±1%" } }, { @@ -102,7 +102,7 @@ "expected": { "value": 6.89, "unit": "kiloohms", - "tolerance":"±1%", + "tolerance":"±1%" } }, { @@ -115,7 +115,7 @@ "expected": { "value": 7.3, "unit": "kiloohms", - "tolerance":"±0.05%", + "tolerance":"±0.05%" } }, { @@ -128,7 +128,7 @@ "expected": { "value": 12.3, "unit": "megaohms", - "tolerance":"±0.25%", + "tolerance":"±0.25%" } }, { @@ -141,7 +141,7 @@ "expected": { "value": 1.01, "unit": "megaohms", - "tolerance":"±0.1%", + "tolerance":"±0.1%" } }, { @@ -154,7 +154,7 @@ "expected": { "value": 1, "unit": "kiloohms", - "tolerance":"±2%", + "tolerance":"±2%" } } ] From 96ef5a8af839eb85c6db9f0b97b946f43365b9ad Mon Sep 17 00:00:00 2001 From: Cool-Katt Date: Tue, 8 Sep 2026 15:05:23 +0300 Subject: [PATCH 03/12] More stupid formatting fixes. --- .../resistor-color-expert/canonical-data.json | 26 ++++++++++--------- .../resistor-color-expert/description.md | 3 +-- 2 files changed, 15 insertions(+), 14 deletions(-) diff --git a/exercises/resistor-color-expert/canonical-data.json b/exercises/resistor-color-expert/canonical-data.json index 56ab175f86..98e1ae4ed9 100644 --- a/exercises/resistor-color-expert/canonical-data.json +++ b/exercises/resistor-color-expert/canonical-data.json @@ -11,7 +11,7 @@ "expected": { "value": 33, "unit": "ohms", - "tolerance":"±2%" + "tolerance": "±2%" } }, { @@ -24,7 +24,7 @@ "expected": { "value": 680, "unit": "ohms", - "tolerance":"±0.1%" + "tolerance": "±0.1%" } }, { @@ -37,7 +37,7 @@ "expected": { "value": 2, "unit": "kiloohms", - "tolerance":"±0.5%" + "tolerance": "±0.5%" } }, { @@ -50,13 +50,15 @@ "expected": { "value": 51, "unit": "kiloohms", - "tolerance":"±0.5%" + "tolerance": "±0.5%" } }, { "uuid": "1cb18e15-1fc5-4375-8a24-ca6eee130a27", "description": "Only one band", - "comments":["One band resistors only have the color black with a value of 0 and no tolerance."], + "comments":[ + "One band resistors only have the color black with a value of 0 and no tolerance." + ], "property": "labelDecoder", "input": { "colors": ["black"] @@ -76,7 +78,7 @@ "expected": { "value": 334, "unit": "ohms", - "tolerance":"±1%" + "tolerance": "±1%" } }, { @@ -89,7 +91,7 @@ "expected": { "value": 2.54, "unit": "megaohms", - "tolerance":"±1%" + "tolerance": "±1%" } }, { @@ -102,7 +104,7 @@ "expected": { "value": 6.89, "unit": "kiloohms", - "tolerance":"±1%" + "tolerance": "±1%" } }, { @@ -115,7 +117,7 @@ "expected": { "value": 7.3, "unit": "kiloohms", - "tolerance":"±0.05%" + "tolerance": "±0.05%" } }, { @@ -128,7 +130,7 @@ "expected": { "value": 12.3, "unit": "megaohms", - "tolerance":"±0.25%" + "tolerance": "±0.25%" } }, { @@ -141,7 +143,7 @@ "expected": { "value": 1.01, "unit": "megaohms", - "tolerance":"±0.1%" + "tolerance": "±0.1%" } }, { @@ -154,7 +156,7 @@ "expected": { "value": 1, "unit": "kiloohms", - "tolerance":"±2%" + "tolerance": "±2%" } } ] diff --git a/exercises/resistor-color-expert/description.md b/exercises/resistor-color-expert/description.md index 0b4a71f00a..f51b345bb9 100644 --- a/exercises/resistor-color-expert/description.md +++ b/exercises/resistor-color-expert/description.md @@ -57,7 +57,6 @@ Examples: There are also one band resistors. One band resistors only have the color black with a value of 0. - Your program should translate an input `list` of resistor band colors into a label: "... ohms ±...%" @@ -79,4 +78,4 @@ So an input `list` of `["orange", "orange", "blue", "red"]` should return: "33 megaohms ±2%" -[resistor-color-trio-exercise]: https://exercism.org/tracks/python/exercises/resistor-color-trio \ No newline at end of file +[resistor-color-trio-exercise]: https://exercism.org/tracks/python/exercises/resistor-color-trio From e20a463494434db0bc10ea61c3cf52a75ad92ea3 Mon Sep 17 00:00:00 2001 From: Cool-Katt Date: Tue, 8 Sep 2026 15:13:42 +0300 Subject: [PATCH 04/12] Please no more CI errors... --- exercises/resistor-color-expert/canonical-data.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/resistor-color-expert/canonical-data.json b/exercises/resistor-color-expert/canonical-data.json index 98e1ae4ed9..07b3abd1aa 100644 --- a/exercises/resistor-color-expert/canonical-data.json +++ b/exercises/resistor-color-expert/canonical-data.json @@ -56,7 +56,7 @@ { "uuid": "1cb18e15-1fc5-4375-8a24-ca6eee130a27", "description": "Only one band", - "comments":[ + "comments": [ "One band resistors only have the color black with a value of 0 and no tolerance." ], "property": "labelDecoder", From d579af766acdab61cfe5e772e604c1833672f97f Mon Sep 17 00:00:00 2001 From: Cool-Katt Date: Wed, 9 Sep 2026 11:09:30 +0300 Subject: [PATCH 05/12] Name change and scenarios addition --- .../canonical-data.json | 6 +++++- .../description.md | 0 .../metadata.toml | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) rename exercises/{resistor-color-expert => resistor-color-tolerance}/canonical-data.json (95%) rename exercises/{resistor-color-expert => resistor-color-tolerance}/description.md (100%) rename exercises/{resistor-color-expert => resistor-color-tolerance}/metadata.toml (87%) diff --git a/exercises/resistor-color-expert/canonical-data.json b/exercises/resistor-color-tolerance/canonical-data.json similarity index 95% rename from exercises/resistor-color-expert/canonical-data.json rename to exercises/resistor-color-tolerance/canonical-data.json index 07b3abd1aa..7258eaa7f3 100644 --- a/exercises/resistor-color-expert/canonical-data.json +++ b/exercises/resistor-color-tolerance/canonical-data.json @@ -1,5 +1,5 @@ { - "exercise": "resistor-color-expert", + "exercise": "resistor-color-tolerance", "cases": [ { "uuid": "fb677832-9a1b-4493-a5b0-786db5a8479c", @@ -97,6 +97,7 @@ { "uuid": "7998837e-fdfa-48c6-9191-0ab27c4777cc", "description": "Blue, gray, white, brown and brown", + "scenarios": ["floating-point"], "property": "labelDecoder", "input": { "colors": ["blue", "grey", "white", "brown", "brown"] @@ -110,6 +111,7 @@ { "uuid": "51554e9f-c21d-4a73-a54c-1d9a973eaed0", "description": "Violet, orange, red and gray", + "scenarios": ["floating-point"], "property": "labelDecoder", "input": { "colors": ["violet", "orange", "red", "grey"] @@ -123,6 +125,7 @@ { "uuid": "68aa7ba3-2334-411a-b3a4-7c47fe20fd99", "description": "Brown, red, orange, green and blue", + "scenarios": ["floating-point"], "property": "labelDecoder", "input": { "colors": ["brown", "red", "orange", "green", "blue"] @@ -136,6 +139,7 @@ { "uuid": "f6069edc-099b-429b-b2a9-bbe2537d2fae", "description": "Brown, black, brown, yellow and violet", + "scenarios": ["floating-point"], "property": "labelDecoder", "input": { "colors": ["brown", "black", "brown", "yellow", "violet"] diff --git a/exercises/resistor-color-expert/description.md b/exercises/resistor-color-tolerance/description.md similarity index 100% rename from exercises/resistor-color-expert/description.md rename to exercises/resistor-color-tolerance/description.md diff --git a/exercises/resistor-color-expert/metadata.toml b/exercises/resistor-color-tolerance/metadata.toml similarity index 87% rename from exercises/resistor-color-expert/metadata.toml rename to exercises/resistor-color-tolerance/metadata.toml index 9fe36e62e7..ccf05c48b6 100644 --- a/exercises/resistor-color-expert/metadata.toml +++ b/exercises/resistor-color-tolerance/metadata.toml @@ -1,4 +1,4 @@ -title = "Resistor Color Expert" +title = "Resistor Color Tolerance" blurb = "Convert color codes as used on resistors with different bands to a human-readable label." source = "Ported for the Python Track" source_url = "https://github.com/exercism/python/tree/main/exercises/practice/resistor-color-expert" From 9685af6034818c199f5fa39b167eaf491366f423 Mon Sep 17 00:00:00 2001 From: Cool-Katt Date: Wed, 16 Sep 2026 10:38:35 +0300 Subject: [PATCH 06/12] Dyslexia go the better of me --- exercises/resistor-color-tolerance/metadata.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/resistor-color-tolerance/metadata.toml b/exercises/resistor-color-tolerance/metadata.toml index ccf05c48b6..3175fff39b 100644 --- a/exercises/resistor-color-tolerance/metadata.toml +++ b/exercises/resistor-color-tolerance/metadata.toml @@ -1,4 +1,4 @@ title = "Resistor Color Tolerance" blurb = "Convert color codes as used on resistors with different bands to a human-readable label." -source = "Ported for the Python Track" +source = "Ported from the Python Track" source_url = "https://github.com/exercism/python/tree/main/exercises/practice/resistor-color-expert" From 5513bf38fc1a8f7a86ae4a49f8b60c501e28b12a Mon Sep 17 00:00:00 2001 From: Cool-Katt Date: Fri, 16 Oct 2026 22:50:09 +0300 Subject: [PATCH 07/12] Update exercises/resistor-color-tolerance/description.md Co-authored-by: Victor Goff --- .../resistor-color-tolerance/description.md | 23 +++++++++++-------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/exercises/resistor-color-tolerance/description.md b/exercises/resistor-color-tolerance/description.md index f51b345bb9..20a58c408a 100644 --- a/exercises/resistor-color-tolerance/description.md +++ b/exercises/resistor-color-tolerance/description.md @@ -4,16 +4,19 @@ In this exercise, you are going to create a helpful program so that you don't ha The program will take 1, 4, or 5 colors as input and output 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 +| Color | Value | +|-------------|-------| +| Black | 0 | +| Brown | 1 | +| Red | 2 | +| Orange | 3 | +| Yellow | 4 | +| Green | 5 | +| Blue | 6 | +| Violet | 7 | +| Gray | 8 | +| White | 9 | +|-------------|-------| In [`Resistor Color Trio`][resistor-color-trio-exercise] you decoded the first three color bands. For instance: orange-orange-brown translated to the main value `330`. From a8a6ce279db285cb526ddd70b9fd583567ea0db5 Mon Sep 17 00:00:00 2001 From: Cool-Katt Date: Fri, 16 Oct 2026 22:50:24 +0300 Subject: [PATCH 08/12] Update exercises/resistor-color-tolerance/description.md Co-authored-by: Victor Goff --- .../resistor-color-tolerance/description.md | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/exercises/resistor-color-tolerance/description.md b/exercises/resistor-color-tolerance/description.md index 20a58c408a..d47cb16ab4 100644 --- a/exercises/resistor-color-tolerance/description.md +++ b/exercises/resistor-color-tolerance/description.md @@ -26,14 +26,17 @@ For example, if the last band is green, the maximum tolerance will be `±0.5%`. The tolerance band will have one of these values: -- grey - 0.05% -- violet - 0.1% -- blue - 0.25% -- green - 0.5% -- brown - 1% -- red - 2% -- gold - 5% -- silver - 10% +| Color | Tolerance | +|--------|----------:| +| Grey | ±0.05% | +| Violet | ±0.10% | +| Blue | ±0.25% | +| Green | ±0.50% | +| Brown | ±1.00% | +| Red | ±2.00% | +| Gold | ±5.00% | +| Silver | ±10.00% | +|--------|-----------| The four-band resistor is built up like this: From 52fa60a0ef05efdbf3c420a1e2ad0f692d1003c4 Mon Sep 17 00:00:00 2001 From: Cool-Katt Date: Fri, 16 Oct 2026 22:51:08 +0300 Subject: [PATCH 09/12] Update exercises/resistor-color-tolerance/metadata.toml Co-authored-by: Isaac Good --- exercises/resistor-color-tolerance/metadata.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/resistor-color-tolerance/metadata.toml b/exercises/resistor-color-tolerance/metadata.toml index 3175fff39b..1b29a3cc82 100644 --- a/exercises/resistor-color-tolerance/metadata.toml +++ b/exercises/resistor-color-tolerance/metadata.toml @@ -1,4 +1,4 @@ title = "Resistor Color Tolerance" blurb = "Convert color codes as used on resistors with different bands to a human-readable label." -source = "Ported from the Python Track" +source = "@meatball133" source_url = "https://github.com/exercism/python/tree/main/exercises/practice/resistor-color-expert" From 8740d3286b850381a069af476b9cdbe4739e15f5 Mon Sep 17 00:00:00 2001 From: Cool-Katt Date: Sat, 17 Oct 2026 00:16:31 +0300 Subject: [PATCH 10/12] Update exercises/resistor-color-tolerance/description.md Co-authored-by: Isaac Good --- .../resistor-color-tolerance/description.md | 25 +++++++++---------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/exercises/resistor-color-tolerance/description.md b/exercises/resistor-color-tolerance/description.md index d47cb16ab4..f1cc2356ff 100644 --- a/exercises/resistor-color-tolerance/description.md +++ b/exercises/resistor-color-tolerance/description.md @@ -4,19 +4,18 @@ In this exercise, you are going to create a helpful program so that you don't ha The program will take 1, 4, or 5 colors as input and output the correct value in ohms. The color bands are encoded as follows: -| Color | Value | -|-------------|-------| -| Black | 0 | -| Brown | 1 | -| Red | 2 | -| Orange | 3 | -| Yellow | 4 | -| Green | 5 | -| Blue | 6 | -| Violet | 7 | -| Gray | 8 | -| White | 9 | -|-------------|-------| +| Color | Value | +| ------------- | ------- | +| Black | 0 | +| Brown | 1 | +| Red | 2 | +| Orange | 3 | +| Yellow | 4 | +| Green | 5 | +| Blue | 6 | +| Violet | 7 | +| Gray | 8 | +| White | 9 | In [`Resistor Color Trio`][resistor-color-trio-exercise] you decoded the first three color bands. For instance: orange-orange-brown translated to the main value `330`. From 71447de368b9280738b0762ac37650e24bbf33ce Mon Sep 17 00:00:00 2001 From: Cool-Katt Date: Sat, 17 Oct 2026 00:16:48 +0300 Subject: [PATCH 11/12] Update exercises/resistor-color-tolerance/description.md Co-authored-by: Isaac Good --- .../resistor-color-tolerance/description.md | 21 +++++++++---------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/exercises/resistor-color-tolerance/description.md b/exercises/resistor-color-tolerance/description.md index f1cc2356ff..5155e8f398 100644 --- a/exercises/resistor-color-tolerance/description.md +++ b/exercises/resistor-color-tolerance/description.md @@ -25,17 +25,16 @@ For example, if the last band is green, the maximum tolerance will be `±0.5%`. The tolerance band will have one of these values: -| Color | Tolerance | -|--------|----------:| -| Grey | ±0.05% | -| Violet | ±0.10% | -| Blue | ±0.25% | -| Green | ±0.50% | -| Brown | ±1.00% | -| Red | ±2.00% | -| Gold | ±5.00% | -| Silver | ±10.00% | -|--------|-----------| +| Color | Tolerance | +| -------- | ----------: | +| Grey | ±0.05% | +| Violet | ±0.10% | +| Blue | ±0.25% | +| Green | ±0.50% | +| Brown | ±1.00% | +| Red | ±2.00% | +| Gold | ±5.00% | +| Silver | ±10.00% | The four-band resistor is built up like this: From 9b7add56ac2731157f0019042f1431c142e6a654 Mon Sep 17 00:00:00 2001 From: Cool-Katt Date: Sat, 17 Oct 2026 00:44:45 +0300 Subject: [PATCH 12/12] Linting .md file properly this time and not being lazy --- .../resistor-color-tolerance/description.md | 44 +++++++++---------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/exercises/resistor-color-tolerance/description.md b/exercises/resistor-color-tolerance/description.md index 5155e8f398..efc8e1f9c0 100644 --- a/exercises/resistor-color-tolerance/description.md +++ b/exercises/resistor-color-tolerance/description.md @@ -4,18 +4,18 @@ In this exercise, you are going to create a helpful program so that you don't ha The program will take 1, 4, or 5 colors as input and output the correct value in ohms. The color bands are encoded as follows: -| Color | Value | -| ------------- | ------- | -| Black | 0 | -| Brown | 1 | -| Red | 2 | -| Orange | 3 | -| Yellow | 4 | -| Green | 5 | -| Blue | 6 | -| Violet | 7 | -| Gray | 8 | -| White | 9 | +| Color | Value | +| ------ | ----- | +| Black | 0 | +| Brown | 1 | +| Red | 2 | +| Orange | 3 | +| Yellow | 4 | +| Green | 5 | +| Blue | 6 | +| Violet | 7 | +| Gray | 8 | +| White | 9 | In [`Resistor Color Trio`][resistor-color-trio-exercise] you decoded the first three color bands. For instance: orange-orange-brown translated to the main value `330`. @@ -25,16 +25,16 @@ For example, if the last band is green, the maximum tolerance will be `±0.5%`. The tolerance band will have one of these values: -| Color | Tolerance | -| -------- | ----------: | -| Grey | ±0.05% | -| Violet | ±0.10% | -| Blue | ±0.25% | -| Green | ±0.50% | -| Brown | ±1.00% | -| Red | ±2.00% | -| Gold | ±5.00% | -| Silver | ±10.00% | +| Color | Tolerance | +| ------ | --------: | +| Grey | ±0.05% | +| Violet | ±0.10% | +| Blue | ±0.25% | +| Green | ±0.50% | +| Brown | ±1.00% | +| Red | ±2.00% | +| Gold | ±5.00% | +| Silver | ±10.00% | The four-band resistor is built up like this: