Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # def triangle(a, b, c)
- # if a==b or b==c or a==c
- # if a==b and b==c and a==c
- # :equilateral
- # else
- # :isosceles
- # end
- # else
- # :scalene
- # end
- # end
- def triangle(a, b, c)
- case [a, b, c].uniq.size
- when 1
- :equilateral
- when 2
- :isosceles
- when 3
- :scalene
- end
- end
Add Comment
Please, Sign In to add comment