exercism / prolog

Exercism exercises in Prolog.
https://exercism.org/tracks/prolog
MIT License
29 stars 37 forks source link

Inconsistency in core exercise: `triangle` #130

Closed booniepepper closed 3 years ago

booniepepper commented 3 years ago

The definition of "isosceles" in the triangle exercise says:

An isosceles triangle has at least two sides the same length. (It is sometimes specified as having exactly two sides the same length, but for the purposes of this exercise we'll say at least two.)

But the tests are siding with Euclid and will give a "Test succeeded with choicepoint." warning for equilateral triangles. It should instead be testing that all equilateral triangles are also isosceles.

neenjaw commented 3 years ago

Yes, the definition should possibly be tightened if we were to continue to use this current test suite. I think in the test case (which we updated ~2 years ago) we made a decision to encourage a deterministic solution, but I am open to testing a non-deterministic solutions as well (see: https://www.swi-prolog.org/pldoc/man?section=testbody).

So I think we could: a) Change the wording of the problem when ask students to write deterministic solutions (succeed with no choicepoint) b) Keep the wording of the problem, but update the testsuite to accept a non-deterministic answers.

Either are good. If you are willing to open a PR for this change, I would be willing to review it.

Thanks for bringing this issue up, @hiljusti 🙂 🎉

booniepepper commented 3 years ago

(I'm willing to do the PR, also to review other PRs. Just trying to find the time :) )