Kara draws the triangle row by row, walking alternatively from left to right and from right to left:
HEIGHT = 5 currentWidth = 1 left2right = true HEIGHT.times { paintRow (kara, currentWidth) gotoNextRow (kara, left2right) left2right = ! left2right currentWidth = currentWidth + 2 } paintRow (kara, currentWidth)