Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resistor series # 2 : ResistorColors #1464

Closed
emcoding opened this issue Feb 15, 2019 · 12 comments
Closed

Resistor series # 2 : ResistorColors #1464

emcoding opened this issue Feb 15, 2019 · 12 comments
Assignees

Comments

@emcoding
Copy link
Contributor

emcoding commented Feb 15, 2019

The ResistorColor exercise is meant as the start of a series of resistor decoding exercises.
Here's number 2: the Resistor Significants exercise.

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:
image
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).

@Smarticles101
Copy link
Member

How many are planned for the series?

@emcoding
Copy link
Contributor Author

That's not decided. I added a link to the original post with the description of the series. 👍

@gabriel376
Copy link

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
Copy link
Member

Instead, we can add more cases to canonical data

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
Copy link

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
Copy link
Contributor Author

Katrina wrote:

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:
...

Is this the direction you're thinking @kytrinyx ?

@kytrinyx
Copy link
Member

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!

@emcoding
Copy link
Contributor Author

Cool! Thanks

@pgaspar
Copy link
Member

pgaspar commented Feb 26, 2019

Also appreciate the less technical description! 🙌

@rpottsoh
Copy link
Member

I like one. I don't like two.

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.

@emcoding emcoding changed the title Resistor series # 2 : ResistorSignificants Resistor series # 2 : ResistorColors Mar 10, 2019
@vinc86
Copy link

vinc86 commented 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
Copy link
Member

rpottsoh commented 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants