diff --git a/config.json b/config.json
index 40e298a3..1b1ef8e1 100644
--- a/config.json
+++ b/config.json
@@ -652,6 +652,15 @@
"prerequisites": [],
"difficulty": 1,
"topics": []
+ },
+ {
+ "slug": "resistor-color-duo",
+ "name": "Resistor Color Duo",
+ "uuid": "81241181-f6a5-4f00-af8c-98bc46517f53",
+ "practices": [],
+ "prerequisites": [],
+ "difficulty": 1,
+ "topics": []
}
]
},
diff --git a/exercises/practice/resistor-color-duo/.docs/instructions.md b/exercises/practice/resistor-color-duo/.docs/instructions.md
new file mode 100644
index 00000000..bdcd549b
--- /dev/null
+++ b/exercises/practice/resistor-color-duo/.docs/instructions.md
@@ -0,0 +1,33 @@
+# Instructions
+
+If you want to build something using a Raspberry Pi, you'll probably use _resistors_.
+For this exercise, you need to know two 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 has a position and a numeric value.
+
+The first 2 bands of a resistor have a simple encoding scheme: each color maps to a single 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 color names as input and output a two digit number, even if the input is more than two colors!
+
+The band colors are encoded as follows:
+
+- Black: 0
+- Brown: 1
+- Red: 2
+- Orange: 3
+- Yellow: 4
+- Green: 5
+- Blue: 6
+- Violet: 7
+- Grey: 8
+- White: 9
+
+From the example above:
+brown-green should return 15
+brown-green-violet should return 15 too, ignoring the third color.
diff --git a/exercises/practice/resistor-color-duo/.meta/config.json b/exercises/practice/resistor-color-duo/.meta/config.json
new file mode 100644
index 00000000..be0c4dd3
--- /dev/null
+++ b/exercises/practice/resistor-color-duo/.meta/config.json
@@ -0,0 +1,19 @@
+{
+ "authors": [
+ "habere-et-dispertire"
+ ],
+ "files": {
+ "solution": [
+ "ResistorColorDuo.rakumod"
+ ],
+ "test": [
+ "resistor-color-duo.rakutest"
+ ],
+ "example": [
+ ".meta/solutions/ResistorColorDuo.rakumod"
+ ]
+ },
+ "blurb": "Convert color codes, as used on resistors, to a numeric value.",
+ "source": "Maud de Vries, Erik Schierboom",
+ "source_url": "https://github.com/exercism/problem-specifications/issues/1464"
+}
diff --git a/exercises/practice/resistor-color-duo/.meta/solutions/ResistorColorDuo.rakumod b/exercises/practice/resistor-color-duo/.meta/solutions/ResistorColorDuo.rakumod
new file mode 100644
index 00000000..a65060c2
--- /dev/null
+++ b/exercises/practice/resistor-color-duo/.meta/solutions/ResistorColorDuo.rakumod
@@ -0,0 +1,6 @@
+unit module ResistorColorDuo;
+
+my constant @BANDS = < black brown red orange yellow green blue violet grey white >;
+sub decoded-value ( *@colors ) is export {
+ @BANDS.antipairs.Hash{ @colors[ 0 .. 1 ] }.join.Int
+}
diff --git a/exercises/practice/resistor-color-duo/.meta/solutions/resistor-color-duo.rakutest b/exercises/practice/resistor-color-duo/.meta/solutions/resistor-color-duo.rakutest
new file mode 120000
index 00000000..023b7511
--- /dev/null
+++ b/exercises/practice/resistor-color-duo/.meta/solutions/resistor-color-duo.rakutest
@@ -0,0 +1 @@
+../../resistor-color-duo.rakutest
\ No newline at end of file
diff --git a/exercises/practice/resistor-color-duo/.meta/template-data.yaml b/exercises/practice/resistor-color-duo/.meta/template-data.yaml
new file mode 100644
index 00000000..9affaaf2
--- /dev/null
+++ b/exercises/practice/resistor-color-duo/.meta/template-data.yaml
@@ -0,0 +1,24 @@
+unit: module
+
+properties:
+ value:
+ test: |-
+ sprintf(q:to/END/, %case.List.Str, (%case, %case).map(*.raku));
+ cmp-ok(
+ decoded-value(<%s>),
+ "eqv",
+ %s,
+ %s,
+ );
+ END
+
+example: |-
+ my constant @BANDS = < black brown red orange yellow green blue violet grey white >;
+ sub decoded-value ( *@colors ) is export {
+ @BANDS.antipairs.Hash{ @colors[ 0 .. 1 ] }.join.Int
+ }
+
+
+stub: |-
+ sub decoded-value ( *@colors ) is export {
+ }
diff --git a/exercises/practice/resistor-color-duo/.meta/tests.toml b/exercises/practice/resistor-color-duo/.meta/tests.toml
new file mode 100644
index 00000000..9036fc78
--- /dev/null
+++ b/exercises/practice/resistor-color-duo/.meta/tests.toml
@@ -0,0 +1,31 @@
+# This is an auto-generated file.
+#
+# Regenerating this file via `configlet sync` will:
+# - Recreate every `description` key/value pair
+# - Recreate every `reimplements` key/value pair, where they exist in problem-specifications
+# - Remove any `include = true` key/value pair (an omitted `include` key implies inclusion)
+# - Preserve any other key/value pair
+#
+# As user-added comments (using the # character) will be removed when this file
+# is regenerated, comments can be added via a `comment` key.
+
+[ce11995a-5b93-4950-a5e9-93423693b2fc]
+description = "Brown and black"
+
+[7bf82f7a-af23-48ba-a97d-38d59406a920]
+description = "Blue and grey"
+
+[f1886361-fdfd-4693-acf8-46726fe24e0c]
+description = "Yellow and violet"
+
+[b7a6cbd2-ae3c-470a-93eb-56670b305640]
+description = "White and red"
+
+[77a8293d-2a83-4016-b1af-991acc12b9fe]
+description = "Orange and orange"
+
+[0c4fb44f-db7c-4d03-afa8-054350f156a8]
+description = "Ignore additional colors"
+
+[4a8ceec5-0ab4-4904-88a4-daf953a5e818]
+description = "Black and brown, one-digit"
diff --git a/exercises/practice/resistor-color-duo/ResistorColorDuo.rakumod b/exercises/practice/resistor-color-duo/ResistorColorDuo.rakumod
new file mode 100644
index 00000000..6c3dad31
--- /dev/null
+++ b/exercises/practice/resistor-color-duo/ResistorColorDuo.rakumod
@@ -0,0 +1,4 @@
+unit module ResistorColorDuo;
+
+sub decoded-value ( *@colors ) is export {
+}
diff --git a/exercises/practice/resistor-color-duo/resistor-color-duo.rakutest b/exercises/practice/resistor-color-duo/resistor-color-duo.rakutest
new file mode 100755
index 00000000..f57676ea
--- /dev/null
+++ b/exercises/practice/resistor-color-duo/resistor-color-duo.rakutest
@@ -0,0 +1,55 @@
+#!/usr/bin/env raku
+use Test;
+use lib $?FILE.IO.dirname;
+use ResistorColorDuo;
+
+cmp-ok( # begin: ce11995a-5b93-4950-a5e9-93423693b2fc
+ decoded-value(),
+ "eqv",
+ 10,
+ "Brown and black",
+); # end: ce11995a-5b93-4950-a5e9-93423693b2fc
+
+cmp-ok( # begin: 7bf82f7a-af23-48ba-a97d-38d59406a920
+ decoded-value(),
+ "eqv",
+ 68,
+ "Blue and grey",
+); # end: 7bf82f7a-af23-48ba-a97d-38d59406a920
+
+cmp-ok( # begin: f1886361-fdfd-4693-acf8-46726fe24e0c
+ decoded-value(),
+ "eqv",
+ 47,
+ "Yellow and violet",
+); # end: f1886361-fdfd-4693-acf8-46726fe24e0c
+
+cmp-ok( # begin: b7a6cbd2-ae3c-470a-93eb-56670b305640
+ decoded-value(),
+ "eqv",
+ 92,
+ "White and red",
+); # end: b7a6cbd2-ae3c-470a-93eb-56670b305640
+
+cmp-ok( # begin: 77a8293d-2a83-4016-b1af-991acc12b9fe
+ decoded-value(),
+ "eqv",
+ 33,
+ "Orange and orange",
+); # end: 77a8293d-2a83-4016-b1af-991acc12b9fe
+
+cmp-ok( # begin: 0c4fb44f-db7c-4d03-afa8-054350f156a8
+ decoded-value(),
+ "eqv",
+ 51,
+ "Ignore additional colors",
+); # end: 0c4fb44f-db7c-4d03-afa8-054350f156a8
+
+cmp-ok( # begin: 4a8ceec5-0ab4-4904-88a4-daf953a5e818
+ decoded-value(),
+ "eqv",
+ 1,
+ "Black and brown, one-digit",
+); # end: 4a8ceec5-0ab4-4904-88a4-daf953a5e818
+
+done-testing;