|Blaine Motsinger f8b7acbeba optimizations||1 year ago|
|README.md||1 year ago|
|triangle.go||1 year ago|
|triangle_test.go||1 year ago|
Determine if a triangle is equilateral, isosceles, or scalene.
An equilateral triangle has all three sides the same length.
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.)
A scalene triangle has all sides of different lengths.
For a shape to be a triangle at all, all sides have to be of length > 0, and the sum of the lengths of any two sides must be greater than or equal to the length of the third side. See Triangle Inequality.
The case where the sum of the lengths of two sides equals that of the third is known as a degenerate triangle - it has zero area and looks like a single line. Feel free to add your own code/tests to check for degenerate triangles.
In this exercise you are asked to declare a series of constants used to identify different types of triangles. Pick the data type you think works best for this and get the tests passing.
To run the tests run the command
go test from within the exercise directory.
If the test suite contains benchmarks, you can run these with the
go test -v --bench . --benchmem
Keep in mind that each reviewer will run benchmarks on a different machine, with different specs, so the results from these benchmark tests may vary.
For more detailed information about the Go track, including how to get help if you’re having trouble, please visit the exercism.io Go language page.
The Ruby Koans triangle project, parts 1 & 2 http://rubykoans.com
It’s possible to submit an incomplete solution so you can see how others have completed the exercise.