You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For this exercise, a given input represents the colors of the first 2 bands of a resistor, for instance ['brown', 'black'] and should return the combined number value 10.
This are real life examples of such color combinations:
translated to tests:
brown and black -> 10
orange and orange -> 33,
blue and grey -> 68
yellow and violet -> 47
About the naming:
The two first bands of resistors are also referenced to as 'significant figures'. The other bands have a different meaning (number of zeros, percentages).
I was going to create this very same issue.
I think the Resistor Color Problem is too simple and should contain series like real-world examples. I just solved it for Java and I am going to implement it for Python track (see exercism/python#1680)
I don't think we should create a new Resistor Series Problem. Instead, we can add more cases to canonical data (and update test cases for all tracks).
While I understand this sentiment, I don't think we should do this. Yes, the exercise is very simple, but that is also exactly its goal: to be a simple array exercise. If a track decides that it is too basic, they are of course free not to implement this exercise. For some tracks though, it might be the best array introduction exercise.
Looking through this point of view, Resistor Color as a simple introduction to arrays, it does make sense to keep as it is and create additional exercises that explores more in-depth the use of arrays.
To be honest, I find this exercise really difficult to understand. I don't know anything about resistors, and reading through this I am having a bit of anxiety trying to get past the unfamiliar jargon to figure out what I actually would have to do to solve it.
That's not good!! Thanks for catching that.
It's my bad, because I utterly enjoy diving into domain specific language, and I like that in exercises too. (So, if we represent the polarities of the Exercism user in this regard, we may need to find a balance.)
I can think of two different directions, one leaning on the resistor domain but un-technologize it, one totally moving out of it.
If you would build anything with a Raspberry Pi or an Arduino, one of the first components you need are resistors. In this exercise, it doesn't matter what a resistor is or does, the only thing that matters here is that they come with different values. And that they are tiny. So tiny, that it's hard to read such a value if it were printed on the thing. To solve that, fabricators use color codes that reveals their value. Which is great, but it makes it hard to see the actual value.
You are going to solve this with a program that you can feed two colors, and it will translate the color to a number. For instance "brown" and "black" are code for 1 and 0, and together they represent the value 10.
The color codes are:
...
OR
2)
Your client is a necklace designer who uses 10 colors of beads, that they use in pairs of 2. They want to keep track of all the color pairs they use in each design, but it's way too much work to write down all the colors all the time. So they use a 'color code', where each color has its own number.
You write a program for them to quickly translate the colors to a number, such that 'orange' and 'orange' translates to '33'.
The color codes are:
...
In this exercise, it doesn't matter what a resistor is or does, the only thing that matters here is that they come with different values. And that they are tiny. So tiny, that it's hard to read such a value if it were printed on the thing.
I love it. This would actually totally solve the problem for me.
I think... let's use your new description for now, and we can think about more storifying later!
While one is less technical it is still accurate and is still relateable to a real life situation 👍 . Two feels too contrived. Why does it matter that orange and orange is 33 in relation to beads? In terms of resistors, from one I don't know what 33 means either, but I know we are talking about resistors so 33 has something to do with the characteristics of a resistor. I don't get any sense how 33 is a characteristic of a couple of beads in two...
My opinion may also be biased (pun intended, resistor humor) since I know what resistors are.
Reacted by Maud de Vries, Sascha Mann and irinakalman
@vin86, assuming you are attempting to write a solution on a track that has implemented this exercise, you should look at the test suite provided to determine the nature of the input that is expected.
If you are trying to implement this exercise on a track that currently doesn't offer it then you are welcome to utilize whatever method makes the best sense for the language you are implementing and reviewing how other tracks have implemented the exercise is a good way get started.
Activity
Smarticles101 commentedon Feb 15, 2019
How many are planned for the series?
emcoding commentedon Feb 15, 2019
That's not decided. I added a link to the original post with the description of the series. 👍
gabriel376 commentedon Feb 17, 2019
I was going to create this very same issue.
I think the Resistor Color Problem is too simple and should contain series like real-world examples. I just solved it for Java and I am going to implement it for Python track (see exercism/python#1680)
I don't think we should create a new Resistor Series Problem. Instead, we can add more cases to canonical data (and update test cases for all tracks).
ErikSchierboom commentedon Feb 17, 2019
While I understand this sentiment, I don't think we should do this. Yes, the exercise is very simple, but that is also exactly its goal: to be a simple array exercise. If a track decides that it is too basic, they are of course free not to implement this exercise. For some tracks though, it might be the best array introduction exercise.
gabriel376 commentedon Feb 17, 2019
Looking through this point of view, Resistor Color as a simple introduction to arrays, it does make sense to keep as it is and create additional exercises that explores more in-depth the use of arrays.
emcoding commentedon Feb 26, 2019
Katrina wrote:
That's not good!! Thanks for catching that.
It's my bad, because I utterly enjoy diving into domain specific language, and I like that in exercises too. (So, if we represent the polarities of the Exercism user in this regard, we may need to find a balance.)
I can think of two different directions, one leaning on the resistor domain but un-technologize it, one totally moving out of it.
If you would build anything with a Raspberry Pi or an Arduino, one of the first components you need are resistors. In this exercise, it doesn't matter what a resistor is or does, the only thing that matters here is that they come with different values. And that they are tiny. So tiny, that it's hard to read such a value if it were printed on the thing. To solve that, fabricators use color codes that reveals their value. Which is great, but it makes it hard to see the actual value.
You are going to solve this with a program that you can feed two colors, and it will translate the color to a number. For instance "brown" and "black" are code for
1and0, and together they represent the value10.The color codes are:
...
OR
2)
Your client is a necklace designer who uses 10 colors of beads, that they use in pairs of 2. They want to keep track of all the color pairs they use in each design, but it's way too much work to write down all the colors all the time. So they use a 'color code', where each color has its own number.
You write a program for them to quickly translate the colors to a number, such that 'orange' and 'orange' translates to '33'.
The color codes are:
...
Is this the direction you're thinking @kytrinyx ?
kytrinyx commentedon Feb 26, 2019
I love it. This would actually totally solve the problem for me.
I think... let's use your new description for now, and we can think about more storifying later!
emcoding commentedon Feb 26, 2019
Cool! Thanks
pgaspar commentedon Feb 26, 2019
Also appreciate the less technical description! 🙌
rpottsoh commentedon Feb 27, 2019
I like
one. I don't liketwo.While
oneis less technical it is still accurate and is still relateable to a real life situation 👍 .Twofeels too contrived. Why does it matter that orange and orange is 33 in relation to beads? In terms of resistors, fromoneI don't know what 33 means either, but I know we are talking about resistors so 33 has something to do with the characteristics of a resistor. I don't get any sense how 33 is a characteristic of a couple of beads intwo...My opinion may also be biased (pun intended, resistor humor) since I know what resistors are.
[-]Resistor series # 2 : ResistorSignificants[/-][+]Resistor series # 2 : ResistorColors[/+]vinc86 commentedon Jul 23, 2020
still the instructions on exercism are not really clear for me. It's not specified that should be an "array" what you have to pass as an argument
rpottsoh commentedon Jul 23, 2020
@vin86, assuming you are attempting to write a solution on a track that has implemented this exercise, you should look at the test suite provided to determine the nature of the input that is expected.
If you are trying to implement this exercise on a track that currently doesn't offer it then you are welcome to utilize whatever method makes the best sense for the language you are implementing and reviewing how other tracks have implemented the exercise is a good way get started.
zeektvbox01-hub commentedon Sep 7, 2026
Can we have a 4th exercise on this which talks about 6 resistors?
IsaacG commentedon Sep 7, 2026
You can propose new exercises via the forum.
https://forum.exercism.org/