Skip to content

Instantly share code, notes, and snippets.

View keithtom's full-sized avatar

Keith Tom keithtom

View GitHub Profile
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
def leap_year?(year)
if year % 4 == 0
puts "I am divisible by 4!"
true
elsif year % 100 == 0
puts "I am divisible by 100!"
false
elsif year % 100 == 0 && year % 400 == 0
puts "I am divisible by 100 and 400!"
true