-
Notifications
You must be signed in to change notification settings - Fork 526
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
Add resistor-color exercise #1404
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.
Just took a quick look; it's definitely a good start! Some notes:
- You're going to need to edit the top-level
config.json
to add the exercise there as well. - What is this exercise meant to teach?
- If we can come up with a good educational goal, then could we structure this exercise as a concept exercise instead of a practice?
per maintainer's suggestion Co-authored-by: Peter Goodspeed-Niklaus <[email protected]>
Co-authored-by: Peter Goodspeed-Niklaus <[email protected]>
Co-authored-by: Peter Goodspeed-Niklaus <[email protected]>
Re what this exercise teaches: I think it teaches about C-like enums, also about external crate usage. And the neat "{:?}" formatting trick. As for making this a concept exercise: sure! It's just that I'm new to contributing exercises, so a practice one is certainly easier. However, I'll probably be able to figure things out if necessary. |
Re editing top-level |
Well, here's my attempt, anyway. Please feel free to correct me. |
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.
Some more notes below.
The biggest comment I have is that we have to decide now if this is going to be a concept exercise; it's not something that can be changed after the exercise goes live. This seems plausible to me for teaching the external_crates
concept. Upside: it gets a lot more visibility, as the concepts in Rust still need a lot of fleshing out. Downside: creating the concept requires a fair amount of extra work. If you do decide to convert it to a concept exercise, it should use the enum-iterator
crate.
Concept docs, concept exercise docs.
If you don't want to do the extra work, this is also fine as a practice exercise. Just let me know whether you want to convert this or not.
Co-authored-by: Peter Goodspeed-Niklaus <[email protected]>
Co-authored-by: Peter Goodspeed-Niklaus <[email protected]>
Okay, here's all the fixups for now. I think I should try converting this to a concept exercise, but failing that, this should be good for now. |
Cool, I'll look forward to seeing how this looks as a concept! |
Alright, here is a rough first version of that. (To be clear, some of the text was liberally adapted from Rust's docs.) |
This looks very plausible as a concept to me! |
Co-authored-by: Peter Goodspeed-Niklaus <[email protected]>
Co-authored-by: Peter Goodspeed-Niklaus <[email protected]>
Alright, re-adding the |
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.
Looks good! Thanks for putting in the effort to push this over the finish line.
It works! Albeit not without trouble: it would seem that the crates have to be re-fetched on every test instance, which slows tests down considerably, even leading to timeouts sometimes. That's probably why there was a rule against external crates? |
Hmm, I'm pretty confident that it's not re-fetching the crates each time, because the test runners run offline. That's why there's a list of supported crates in the first place. However, it's worth looking into the timeout rate. |
Ported over from the C track, but with a Rust-ic flavor. Hopefully the external crate usage is okay.