palindrome-product: Clarify requirements#897
Conversation
REF exercism/ruby#305 It's not clear from the current examples what the requirements of this exercise are. In fact, a furtive glance is more likely to cause confusion than give clarity. In my opinion, this is because for the first example the solution lies within the range of the list of factors, giving on a first impression that we are looking for products that lie within this range. I think that by listing out the entire list of products (which is small in the case of the range of 1..9) we make it more clear that we are considering all the results.
| `[1, 2, 3, 4, 5, 6, 7, 8, 9]` | ||
|
|
||
| The smallest palindrome product is `1`. It's factors are `(1, 1)`. | ||
| The largest palindrome product is `9`. It's factors are `(1, 9)`, `(3, 3)`, and `(9, 1)`. |
|
Looks good 👍 |
|
Once this is merged it would be great if you would create an issue or a PR back in the exercism/ruby repository about updating the readme from the updated common description. There is some documentation about how to use Edit: I meant to post this as a reply to exercism/ruby#723, updated to make sense in this context. 😊 |
|
Sure, I'll give that a try once this merged. |
| `[1, 2, 3, 4, 5, 6, 7, 8, 9]` | ||
|
|
||
| The smallest palindrome product is `1`. Its factors are `(1, 1)`. | ||
| The largest palindrome product is `9`. Its factors are `(1, 9)`, `(3, 3)`, and `(9, 1)`. |
There was a problem hiding this comment.
The tests only expect (1,9) and (3,3) as factors.
(and always seem to expect factor pairs in (lowest, highest) order.
There was a problem hiding this comment.
Good point... I forgot I had to sort and uniq my results. I'll udpdate.
The tests do not distinguish between `(a, b)` and `(b, c)`.
|
Thanks @dkinzer 🎉 ! |
* Clarify palindrome product exercise requirements REF exercism/ruby#305 It's not clear from the current examples what the requirements of this exercise are. In fact, a furtive glance is more likely to cause confusion than give clarity. In my opinion, this is because for the first example the solution lies within the range of the list of factors, giving on a first impression that we are looking for products that lie within this range. I think that by listing out the entire list of products (which is small in the case of the range of 1..9) we make it more clear that we are considering all the results. * Fix typo. * Update palindrome-products factors examples. The tests do not distinguish between `(a, b)` and `(b, c)`.
REF exercism/ruby#305
REF exercism/ruby#723
It's not clear from the current examples what the requirements of this exercise are. In fact, a furtive glance is more likely to cause confusion than give clarity.
In my opinion, this is because for the first example the solution lies within the range of the list of factors, giving on a first impression that we are looking for products that lie within this range.
I think that by listing out the entire list of products (which is small in the case of the range of 1..9) we make it more clear that we are considering all the results.