diff --git a/challenges/triangle-type/README.md b/challenges/triangle-type/README.md new file mode 100644 index 0000000..9d743ce --- /dev/null +++ b/challenges/triangle-type/README.md @@ -0,0 +1,20 @@ +# triangle-type + +Created by [@Divlo](https://github.com/Divlo) on 30 June 2021. + +## Instructions + +Given the lengths of the 3 sides of a triangle, your function should return whether it is `equilateral`, `isosceles`, `scalene` or `impossible`. + +- A triangle is `equilateral` when its 3 sides are equal +- A triangle is `isosceles` when 2 of its sides are equal +- A triangle is `scalene` when none of its sides is equal to another side +- A triangle is `impossible` when the sum of two of its sides is strictly less than the third side + +## Input + +- **Line 1 to 3:** The length of each side of the triangle + +## Examples + +See the `test` folder for examples of input/output. diff --git a/challenges/triangle-type/solutions/.gitkeep b/challenges/triangle-type/solutions/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/challenges/triangle-type/test/1/input.txt b/challenges/triangle-type/test/1/input.txt new file mode 100644 index 0000000..84e48a1 --- /dev/null +++ b/challenges/triangle-type/test/1/input.txt @@ -0,0 +1,3 @@ +2 +2 +2 \ No newline at end of file diff --git a/challenges/triangle-type/test/1/output.txt b/challenges/triangle-type/test/1/output.txt new file mode 100644 index 0000000..5d69f76 --- /dev/null +++ b/challenges/triangle-type/test/1/output.txt @@ -0,0 +1 @@ +equilateral \ No newline at end of file diff --git a/challenges/triangle-type/test/10/input.txt b/challenges/triangle-type/test/10/input.txt new file mode 100644 index 0000000..bcff83a --- /dev/null +++ b/challenges/triangle-type/test/10/input.txt @@ -0,0 +1,3 @@ +7 +3 +2 \ No newline at end of file diff --git a/challenges/triangle-type/test/10/output.txt b/challenges/triangle-type/test/10/output.txt new file mode 100644 index 0000000..0a61a2f --- /dev/null +++ b/challenges/triangle-type/test/10/output.txt @@ -0,0 +1 @@ +impossible \ No newline at end of file diff --git a/challenges/triangle-type/test/11/input.txt b/challenges/triangle-type/test/11/input.txt new file mode 100644 index 0000000..46898bc --- /dev/null +++ b/challenges/triangle-type/test/11/input.txt @@ -0,0 +1,3 @@ +10 +1 +3 \ No newline at end of file diff --git a/challenges/triangle-type/test/11/output.txt b/challenges/triangle-type/test/11/output.txt new file mode 100644 index 0000000..0a61a2f --- /dev/null +++ b/challenges/triangle-type/test/11/output.txt @@ -0,0 +1 @@ +impossible \ No newline at end of file diff --git a/challenges/triangle-type/test/12/input.txt b/challenges/triangle-type/test/12/input.txt new file mode 100644 index 0000000..7218b68 --- /dev/null +++ b/challenges/triangle-type/test/12/input.txt @@ -0,0 +1,3 @@ +97 +97 +97 \ No newline at end of file diff --git a/challenges/triangle-type/test/12/output.txt b/challenges/triangle-type/test/12/output.txt new file mode 100644 index 0000000..5d69f76 --- /dev/null +++ b/challenges/triangle-type/test/12/output.txt @@ -0,0 +1 @@ +equilateral \ No newline at end of file diff --git a/challenges/triangle-type/test/2/input.txt b/challenges/triangle-type/test/2/input.txt new file mode 100644 index 0000000..ad94ab9 --- /dev/null +++ b/challenges/triangle-type/test/2/input.txt @@ -0,0 +1,3 @@ +10 +10 +10 \ No newline at end of file diff --git a/challenges/triangle-type/test/2/output.txt b/challenges/triangle-type/test/2/output.txt new file mode 100644 index 0000000..5d69f76 --- /dev/null +++ b/challenges/triangle-type/test/2/output.txt @@ -0,0 +1 @@ +equilateral \ No newline at end of file diff --git a/challenges/triangle-type/test/3/input.txt b/challenges/triangle-type/test/3/input.txt new file mode 100644 index 0000000..16930b0 --- /dev/null +++ b/challenges/triangle-type/test/3/input.txt @@ -0,0 +1,3 @@ +3 +4 +4 \ No newline at end of file diff --git a/challenges/triangle-type/test/3/output.txt b/challenges/triangle-type/test/3/output.txt new file mode 100644 index 0000000..72d391a --- /dev/null +++ b/challenges/triangle-type/test/3/output.txt @@ -0,0 +1 @@ +isosceles \ No newline at end of file diff --git a/challenges/triangle-type/test/4/input.txt b/challenges/triangle-type/test/4/input.txt new file mode 100644 index 0000000..8ef0e0d --- /dev/null +++ b/challenges/triangle-type/test/4/input.txt @@ -0,0 +1,3 @@ +4 +3 +4 \ No newline at end of file diff --git a/challenges/triangle-type/test/4/output.txt b/challenges/triangle-type/test/4/output.txt new file mode 100644 index 0000000..72d391a --- /dev/null +++ b/challenges/triangle-type/test/4/output.txt @@ -0,0 +1 @@ +isosceles \ No newline at end of file diff --git a/challenges/triangle-type/test/5/input.txt b/challenges/triangle-type/test/5/input.txt new file mode 100644 index 0000000..d9347bc --- /dev/null +++ b/challenges/triangle-type/test/5/input.txt @@ -0,0 +1,3 @@ +10 +10 +2 \ No newline at end of file diff --git a/challenges/triangle-type/test/5/output.txt b/challenges/triangle-type/test/5/output.txt new file mode 100644 index 0000000..72d391a --- /dev/null +++ b/challenges/triangle-type/test/5/output.txt @@ -0,0 +1 @@ +isosceles \ No newline at end of file diff --git a/challenges/triangle-type/test/6/input.txt b/challenges/triangle-type/test/6/input.txt new file mode 100644 index 0000000..af64121 --- /dev/null +++ b/challenges/triangle-type/test/6/input.txt @@ -0,0 +1,3 @@ +3 +4 +5 \ No newline at end of file diff --git a/challenges/triangle-type/test/6/output.txt b/challenges/triangle-type/test/6/output.txt new file mode 100644 index 0000000..dcadc9b --- /dev/null +++ b/challenges/triangle-type/test/6/output.txt @@ -0,0 +1 @@ +scalene \ No newline at end of file diff --git a/challenges/triangle-type/test/7/input.txt b/challenges/triangle-type/test/7/input.txt new file mode 100644 index 0000000..98f3e0b --- /dev/null +++ b/challenges/triangle-type/test/7/input.txt @@ -0,0 +1,3 @@ +10 +11 +12 \ No newline at end of file diff --git a/challenges/triangle-type/test/7/output.txt b/challenges/triangle-type/test/7/output.txt new file mode 100644 index 0000000..dcadc9b --- /dev/null +++ b/challenges/triangle-type/test/7/output.txt @@ -0,0 +1 @@ +scalene \ No newline at end of file diff --git a/challenges/triangle-type/test/8/input.txt b/challenges/triangle-type/test/8/input.txt new file mode 100644 index 0000000..0ad6615 --- /dev/null +++ b/challenges/triangle-type/test/8/input.txt @@ -0,0 +1,3 @@ +5 +4 +2 \ No newline at end of file diff --git a/challenges/triangle-type/test/8/output.txt b/challenges/triangle-type/test/8/output.txt new file mode 100644 index 0000000..dcadc9b --- /dev/null +++ b/challenges/triangle-type/test/8/output.txt @@ -0,0 +1 @@ +scalene \ No newline at end of file diff --git a/challenges/triangle-type/test/9/input.txt b/challenges/triangle-type/test/9/input.txt new file mode 100644 index 0000000..9c46309 --- /dev/null +++ b/challenges/triangle-type/test/9/input.txt @@ -0,0 +1,3 @@ +1 +1 +3 \ No newline at end of file diff --git a/challenges/triangle-type/test/9/output.txt b/challenges/triangle-type/test/9/output.txt new file mode 100644 index 0000000..0a61a2f --- /dev/null +++ b/challenges/triangle-type/test/9/output.txt @@ -0,0 +1 @@ +impossible \ No newline at end of file