Skip to content

Instantly share code, notes, and snippets.

@rosiehoyem
Created October 13, 2013 17:19
Show Gist options
  • Save rosiehoyem/6964812 to your computer and use it in GitHub Desktop.
Save rosiehoyem/6964812 to your computer and use it in GitHub Desktop.
Triangle TODO, Day 13
class Triangle
attr_accessor :s1, :s2, :s3
def initialize(s1, s2, s3)
@s1 = s1
@s2 = s2
@s3 = s3
end
def kind
if s1 == s2 && s3 == s1
:equilateral
elsif (s1 == s2 && s3 != s1) || ()
:isosceles
else
:scalene
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment