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 color: no task description #1546

Closed
okeegan opened this issue Jul 4, 2019 · 3 comments · Fixed by #1645
Closed

Resistor color: no task description #1546

okeegan opened this issue Jul 4, 2019 · 3 comments · Fixed by #1645

Comments

@okeegan
Copy link

okeegan commented Jul 4, 2019

The explanation for how resistor colors (#1466) work is fine, but in terms of what the task actually is – there's not much there.


These 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
Mnemonics map the colors to the numbers, that, when stored as an array, happen to map to their index in the array: Better Be Right Or Your Great Big Values Go Wrong.

More information on the color encoding of resistors can be found in the Electronic color code Wikipedia article

I propose the addition of a line that describes the expected input and output for this exercise. Maybe something like:

"Write a function that takes a band color as input and outputs the associated number."

@yawpitch
Copy link
Contributor

yawpitch commented Jul 4, 2019

Hi @okeegan, that's a sensible addition and I'd be happy to accept a pull request, though to make it language/paradigm agnostic and reflect the fact that the canonical data requires more than one function maybe something like "Create the means to list the different band colors and to look up the numerical value associated with a particular band color."?

@rpottsoh
Copy link
Member

rpottsoh commented Jul 4, 2019

Color band instead of band color. Otherwise I think that is good.

@okeegan
Copy link
Author

okeegan commented Jul 5, 2019

In my opinion as a mere noob, "Create the means to list the different band colors..." is implicit in the second half, but otherwise your suggestion rocks @yawpitch.

Also, noted @rpottsoh!

PR is #1548.

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