Triangles in Ruby