{=================================================================== graphics2.p Started by Jeff Ondich on 1/25/95 Last modified 10/11/96 Try it. Then try replacing drawpoly() with drawpolyfilled(). How many sides does the polygon have, compared to the number of points in the polygon array? We'll talk about the ".x" and ".y" notation later. ===================================================================} #include program polygons(input,output); import graphics; const windowWidth = 600; windowHeight = 600; windowBottom = 100; windowLeft = 100; var polygon : polyarray; {=================================================================== StartGraphics initializes the graphics package and opens a black window for drawing. ===================================================================} procedure StartGraphics; begin initializegraphics; createwindow( windowLeft, windowBottom, windowLeft + windowWidth, windowBottom + windowHeight ); setrgbcolor( 0.0, 0.0, 0.0 ); flood; flushgraphics end; {=================================================================== main program ===================================================================} begin StartGraphics; polygon[1].x := 200; polygon[1].y := 100; polygon[2].x := 400; polygon[2].y := 100; polygon[3].x := 500; polygon[3].y := 200; polygon[4].x := 400; polygon[4].y := 300; polygon[5].x := 200; polygon[5].y := 200; setrgbcolor( 0, 1, 0 ); drawpoly( 5, polygon ); flushgraphics; readln end.