Created
June 13, 2012 23:09
-
-
Save perspectivezoom/2927076 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def triangle(n1,n2,n3) | |
n1n2 = n1 == n2 | |
n2n3 = n2 == n3 | |
n1n3 = n1 == n3 | |
if n1 >= n2 + n3 || n2 >= n1 + n3 || n3 >= n1 + n2 | |
:invalid | |
elsif n1n2 && n2n3 && n1n3 | |
:equilateral | |
elsif n1n2 || n2n3 || n1n3 | |
:isosceles | |
else | |
:scalene | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment