Skip to content

Instantly share code, notes, and snippets.

@andyweiss1982
Created July 24, 2014 20:53
Show Gist options
  • Save andyweiss1982/8e2deb9bc968e4c6dc79 to your computer and use it in GitHub Desktop.
Save andyweiss1982/8e2deb9bc968e4c6dc79 to your computer and use it in GitHub Desktop.
Max
def bigger_num (num1, num2)
if num1 > num2
puts num1
elsif num2 > num1
puts num2
else
puts "equal"
end
end
def test_bigger_num
puts bigger_num(1,2)
puts bigger_num(1.0,2.1)
puts bigger_num(nil, nil)
puts bigger_num({},{})
puts bigger_num([],[])
puts bigger_num(false, true)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment