Here's an example of a simple Fill function for equilateral triangles that I came up with to use in another program.
function TriangleFill(x1,y1,d) -- x1,y1 is the bottom left point
d2 = d/2
dx = 1
dy = math.tan(math.pi/3)
x2 = x1 + d
y2 = y1
x3 = x2 + d
while x1 < x2
do
line( x1,y1,x2,y2)
line( x2,y2,x3,y2)
x1 = x1 + .5
y1 = y1 - dy/2
y2 = y1
x3 = x3 - .5
end
end
------------ START OF PROGRAM ---------------
win = openwindow ("Hexagon",-1,-1,1000,700)
setactivewindow (win)
textsize(2)
backcolor (0,0,0,255)
color (0,0,255,255)
TriangleFill(100,600,200)
drawtext("Press any key to exit ..",0,0)
sync()
key=inkey()
closewindow(win) -- This ends the program.
closeapplication()