-
Notifications
You must be signed in to change notification settings - Fork 544
pythagorean-triplet (incorrect) missing tests? #633
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
Comments
A little note: The text you have pasted in your comment is a common template that looks the same across every exercise, so no need to read very hard in it.
|
The README at https://github.com/exercism/rust/blob/master/exercises/pythagorean-triplet/README.md only says "There exists exactly one Pythagorean triplet for which a + b + c = 1000. / Find the product a * b * c." so whoever implemented this exercise in #333 chose to follow the README strictly and only ask for this problem. Adding tests would be a departure from the README. I think I'd recommend changing https://github.com/exercism/problem-specifications/blob/master/exercises/pythagorean-triplet/description.md first so that we are not limiting the change to this track; we wouldn't want to be selfish. |
There was once discussion of this issue (not considering the input) in exercism/problem-specifications#1211 . There is not (yet) anyone who has chosen to do something about it. However I listed some possibilities in the issue. |
Aside from the description to build the implementation, it will probably be a good idea to include some links to documentation to help solve the problem. For me at least it was a suprise to see the first exercise considerably more difficult then the hello world intro without any introduction, but perhaps you expect the person to already have some programming experience and figure it out themselves? |
There are several ways to solve the pythagorean triplet problem. The naive solution is to write a pair of loops to generate and test triplets; loops are pretty fundamental to any language. An only slightly more advanced solution is to use iterators to do the same thing. A moderately advanced solution would be to use recursive descent to solve the problem at compile-time without loops or iterators, such that the assembly contains just a constant. Rust's nightly compiler almost supports this, but as of last week, it's not quite there yet. (It was still fun to try.) An advanced solution would be to treat it as a math problem, solve by hand, and submit a solution with a hard-coded number and several comments about the approach taken. A cheating solution would be to take that number from the tests file, and then write a brief comment falsely claiming that you solved it as a math problem. Given the variety of approaches possible, I'd prefer not to write a comment suggesting any one of them, to avoid priming people in a way which would make it harder for them to think up their own approach. Still, if you feel strongly about this, I am willing to review a PR adding text to In the meantime, I will close this issue, as there is no direct action we can take to resolve it. |
Shouldn't the test do something with the input to calculate the pythagorean-triplet? Also the test was not ignored and there was only one.
https://github.com/exercism/rust/blob/master/exercises/pythagorean-triplet/tests/pythagorean-triplet.rs
The text was updated successfully, but these errors were encountered: