Exercism: Go version of the 'Triangle' exercise.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

27 lines
743 B

9 years ago
  1. # Triangle
  2. Write a program that can tell you if a triangle is equilateral, isosceles, or scalene.
  3. The program should raise an error if the triangle cannot exist.
  4. Tests are provided, delete one `skip` at a time.
  5. ## Hint
  6. The sum of the lengths of any two sides of a triangle always exceeds the
  7. length of the third side, a principle known as the _triangle
  8. inequality_.
  9. To run the tests simply run the command `go test` in the exercise directory.
  10. If the test suite contains benchmarks, you can run these with the `-bench`
  11. flag:
  12. go test -bench .
  13. For more detailed info about the Go track see the [help
  14. page](http://exercism.io/languages/go).
  15. ## Source
  16. The Ruby Koans triangle project, parts 1 & 2 [view source](http://rubykoans.com)