Skip to content

Instantly share code, notes, and snippets.

@keithtom
Forked from stomatocode/gist:5358029
Created April 10, 2013 20:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save keithtom/5358067 to your computer and use it in GitHub Desktop.
Save keithtom/5358067 to your computer and use it in GitHub Desktop.
def valid_triangle?(a, b, c)
if ((a == 0 or b == 0 or c == 0) or (a == nil or b == nil or c == nil))
return false
end
if a + b > c
puts "case 1"
return true
elsif a + c > b
puts "case 2"
return true
elsif b + c > a
puts "case 3"
return true
else
return false
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment