Last active
December 19, 2015 13:18
-
-
Save elreimundo/5960706 to your computer and use it in GitHub Desktop.
Am I cheating? When I taught Geometry, I used to teach my kids that this was the only requirement for a (planar) triangle. I feel like I should be teaching the machine to check for isosceles, equilateral, etc., but if all we want is to determine if a triangle is valid...
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 valid_triangle?(a, b, c) | |
(a + b > c) && (a + c > b) && (b + c > a) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Got rid of that pesky return. :)