Triangle evaluator. Written in Ruby, Sept 2013