Completed triangle.rb