Skip to content

Instantly share code, notes, and snippets.

@danneu
Created August 4, 2011 22:09
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save danneu/1126423 to your computer and use it in GitHub Desktop.
Save danneu/1126423 to your computer and use it in GitHub Desktop.
Ruby Koans 151 triangle.rb solution
def triangle(a, b, c)
raise TriangleError if a<=0 or b<=0 or c<=0
raise TriangleError if a+b<=c or b+c<=a or a+c<=b
return :equilateral if a==b and a==c
return :isosceles if a==b or b==c or a==c
:scalene
end
@asyraffff
Copy link

Thanks for all of you guys

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment