Guest User

Untitled

a guest
Oct 17th, 2018
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.32 KB | None | 0 0
  1. # def triangle(a, b, c)
  2. # if a==b or b==c or a==c
  3. # if a==b and b==c and a==c
  4. # :equilateral
  5. # else
  6. # :isosceles
  7. # end
  8. # else
  9. # :scalene
  10. # end
  11. # end
  12.  
  13. def triangle(a, b, c)
  14. case [a, b, c].uniq.size
  15. when 1
  16. :equilateral
  17. when 2
  18. :isosceles
  19. when 3
  20. :scalene
  21. end
  22. end
Add Comment
Please, Sign In to add comment