Drawing Triangles


The following sections cover the constructor and functions of the TrianglePrinter class.



This constructor creates a new, reusable TrianglePrinter.

The following example shows that you do not need to create a new instance of the TrianglePrinter class for every triangle that you print.

print(TileGrid, Point[])

This function prints a triangle on a TileGrid. The triangle is drawn using an array of three points, where lines are drawn between Point[0]→Point[1], Point[1]→Point[2], and Point[2]→Point[0].


This function sets the character to display on the tiles when printing a triangle.