exercism / cairo

Exercism exercises in Cairo.
https://exercism.org/tracks/cairo
MIT License
6 stars 10 forks source link

Add Practice Exercise: `triangle` #243

Closed 0xNeshi closed 2 months ago

0xNeshi commented 2 months ago

Towards https://github.com/exercism/cairo/issues/113

Problem specification: https://github.com/exercism/problem-specifications/tree/main/exercises/triangle

TODO:

BNAndras commented 2 months ago

For this exercise, there are generally two approaches I've seen for implementation. We provide three functions that check if the sides correspond to a particular kind of triangle, returning true or false (see https://github.com/exercism/csharp/blob/main/exercises/practice/triangle/Triangle.cs). The other approach is that we have a single function that checks the sides and returns what kind of triangle it is (see https://github.com/exercism/elixir/blob/main/exercises/practice/triangle/lib/triangle.ex). In the later case, some of the tests should be excluded where a triangle may be more than one type based on the sides.

Any preference?

0xNeshi commented 2 months ago

Let's go with the former version, as it aligns with the "official" problem specification (https://github.com/exercism/problem-specifications/blob/main/exercises/triangle/canonical-data.json).