From b045c70c1af23e5bed20536f87912b431a9184b4 Mon Sep 17 00:00:00 2001 From: Divlo Date: Wed, 30 Jun 2021 12:25:29 +0200 Subject: [PATCH] feat(challenges): add `triangle-type` --- challenges/triangle-type/README.md | 20 ++++++++++++++++++++ challenges/triangle-type/solutions/.gitkeep | 0 challenges/triangle-type/test/1/input.txt | 3 +++ challenges/triangle-type/test/1/output.txt | 1 + challenges/triangle-type/test/10/input.txt | 3 +++ challenges/triangle-type/test/10/output.txt | 1 + challenges/triangle-type/test/11/input.txt | 3 +++ challenges/triangle-type/test/11/output.txt | 1 + challenges/triangle-type/test/12/input.txt | 3 +++ challenges/triangle-type/test/12/output.txt | 1 + challenges/triangle-type/test/2/input.txt | 3 +++ challenges/triangle-type/test/2/output.txt | 1 + challenges/triangle-type/test/3/input.txt | 3 +++ challenges/triangle-type/test/3/output.txt | 1 + challenges/triangle-type/test/4/input.txt | 3 +++ challenges/triangle-type/test/4/output.txt | 1 + challenges/triangle-type/test/5/input.txt | 3 +++ challenges/triangle-type/test/5/output.txt | 1 + challenges/triangle-type/test/6/input.txt | 3 +++ challenges/triangle-type/test/6/output.txt | 1 + challenges/triangle-type/test/7/input.txt | 3 +++ challenges/triangle-type/test/7/output.txt | 1 + challenges/triangle-type/test/8/input.txt | 3 +++ challenges/triangle-type/test/8/output.txt | 1 + challenges/triangle-type/test/9/input.txt | 3 +++ challenges/triangle-type/test/9/output.txt | 1 + 26 files changed, 68 insertions(+) create mode 100644 challenges/triangle-type/README.md create mode 100644 challenges/triangle-type/solutions/.gitkeep create mode 100644 challenges/triangle-type/test/1/input.txt create mode 100644 challenges/triangle-type/test/1/output.txt create mode 100644 challenges/triangle-type/test/10/input.txt create mode 100644 challenges/triangle-type/test/10/output.txt create mode 100644 challenges/triangle-type/test/11/input.txt create mode 100644 challenges/triangle-type/test/11/output.txt create mode 100644 challenges/triangle-type/test/12/input.txt create mode 100644 challenges/triangle-type/test/12/output.txt create mode 100644 challenges/triangle-type/test/2/input.txt create mode 100644 challenges/triangle-type/test/2/output.txt create mode 100644 challenges/triangle-type/test/3/input.txt create mode 100644 challenges/triangle-type/test/3/output.txt create mode 100644 challenges/triangle-type/test/4/input.txt create mode 100644 challenges/triangle-type/test/4/output.txt create mode 100644 challenges/triangle-type/test/5/input.txt create mode 100644 challenges/triangle-type/test/5/output.txt create mode 100644 challenges/triangle-type/test/6/input.txt create mode 100644 challenges/triangle-type/test/6/output.txt create mode 100644 challenges/triangle-type/test/7/input.txt create mode 100644 challenges/triangle-type/test/7/output.txt create mode 100644 challenges/triangle-type/test/8/input.txt create mode 100644 challenges/triangle-type/test/8/output.txt create mode 100644 challenges/triangle-type/test/9/input.txt create mode 100644 challenges/triangle-type/test/9/output.txt 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