-
-
Notifications
You must be signed in to change notification settings - Fork 552
resistor-colors: add new exercise #1466
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-colors: add new exercise #1466
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I updated the texts to reflect what 'significant figure' exactly means. Is it still clear?
Thanks for creating the exercise. It looks good fun!
@F3PiX I've updated the PR. I am wondering if people won't expect an array/list for the expected value, as the property "significantFigures" does seem to imply that. But maybe they won't :) |
@ErikSchierboom I see what you mean re: the property. 🤔 Is |
I like |
😍 |
What Topic(s) are you envisioning for this exercise? |
It depends a bit on the language involved, but what I envision is that students will now have to learn how to combine to individual numbers into a single number. There are several ways to do that, so it can be quite interesting. |
Could you hold off merging this until @kytrinyx has had chance to take a look pls? |
Yes please wait. I think I may have missed part of the original plan for the series. |
I've updated the PR. What changed is that instead of passing the colors as separate arguments, they are now passes as an array. This keeps them in line with the array-theme of the series. |
I have been reading over the comments here and wonder if perhaps |
Actually, we already used it: https://github.com/exercism/problem-specifications/blob/master/exercises/resistor-color/canonical-data.json :) |
I'm a bit late to the party here, and I am sorry for delaying the process. I'm going to take a really big step backwards here, and not talk about this resistor exercise, but rather I'd like to talk about something which @iHiD and @nicolechalmers and I have been mulling over for some time now. To start, I'd ask that you read this issue: #1470. To summarize: we think that one fundamental change that we could make to Exercism to make the site more engaging is to ensure that each exercise is defined by a story. This helps add color and an element of liveliness (fun?) to the exercise, but much more than that, it helps avoid a situation where an exercise feels overwhelming or foreign or "too hard" (even when it is actually simple). We've found that sometimes the words that we use, or the way that we describe things can make something seem much harder than they actually are. So for the resistor exercises: what does it look like to strip away all the surrounding details from the technical problem? At it's very core, what is each of the resistor exercises asking you to do? |
I think @F3PiX will probably know this better than me, but I figure we could perhaps write this exercise from the viewpoint of a mechanic or something like that? Someone that sees a resistor, and then has to try and figure out its use, or something like that. |
First, I'm a big fan of adding stories to exercises, so 💯 . Then, as so many tracks are really suffering by a lack of easy exercises like this, especially this easiest iterator, I'd vote for not holding up this PR because of the story. We could easily work on the story-telling after this exercise is launched, we can leave the exercise's issue open for that or reopen the series introduction issue, and delete this exercise as soon as there is a better story telling alternative. What do you think @kytrinyx? |
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's keep this on hold until we have the story sorted out.
That's not good!! |
I've posted a comment regarding the description but otherwise everything looks good to me too. 👍 |
Co-Authored-By: ErikSchierboom <erik_schierboom@hotmail.com>
I've applied the comment. Anything else? |
LGTM. Thanks @ErikSchierboom |
Squashed and merged! Thanks for the reviews everybody! |
I apologize if I was too vague on my approval (or lack of it) as it related to my suggested change regarding calling bands strips. I felt strongly enough about the suggested change to mention it, but not strongly enough to require it be changed before giving approval (in GitHub terms). Thanks for making the change! |
No problem! |
We are about to merge the new exercise Resistor Colors. It's introduced as a side exercise first, so I don't expect much mentoring requests, but just in case, here's some preliminary Mentor Notes. They will need evaluating after we've seen some solutions submitted. References: Ruby PR https://github.com/exercism/ruby/pulls Problem Specifications: exercism/problem-specifications#1466 This exercise is meant to be part of a series of Resistor exercises, building up to decoding up to 6 colors: exercism/problem-specifications#1458, and starting with just one color in Resistor Series nr 1
@kytrinyx wrote:
So do I. But mostly because the exercise does not describe what problem to solve, only the problem domain. @iHiD wrote:
Do you mean stuff like how to get started with the track, extra exercise hints, etc.? And now for my question, since @tejasbubane just ported this exercise to Haskell in exercism/haskell#808: If |
|
So The tests don't specify what happens to empty input. The resistor illustrations at #1464 all have three colors. I can see from googling around a little that there can be many color bands, and that in practice you wouldn't have a resistor without colors, since you'd call that a wire. So I suppose that tracks are free to interpret |
This is correct. There is no error handling defined in the tests. Tracks are free to handle errors as they like, possibly adding test cases.
I believe there is special significance for the first two colors, isn't there @F3PiX? |
Value 0 would also be a wire .
Just keep in mind that we deliberately left that out, as this is meant to be nr 2 in a series with increasing complexity. The input validation would be an extra layer that we intend to add to nr 3. (And nr 3 is also going to calculate the value of all three color bands.) This post for the previous one, nr 1, tells a bit more: #1458 |
This commit adds the `resistor-colors` exercise. Problem Specification: exercism/problem-specifications#1466. An algebraic type was chosen for the colors instead of strings to avoid a focus on error handling.
This question wasn't directed at me, but I can answer it: on a 3-band resistor, the 3rd band is a multiplier on the number created by the first 2. So technically, the 3rd band is the one with special significance, not the first 2. |
Right, that makes sense. Thanks for explaining! |
Closes #1464.