Triangle Checker in Ruby