{=================================================================== graphics1.p Started by Jeff Ondich on 1/25/95 Last modified 10/11/96 1. Compile it, run it, and read all the procedures to see what they do. 2. Try changing the parameters passed to SayHello. What do rmoveto and rlineto do? Which is a more generally useful procedure--SayHello, or SayHelloAgain? Why? ===================================================================} #include program drawSomeStuff(Input, Output); import graphics; const windowWidth = 600; windowHeight = 600; windowBottom = 100; windowLeft = 100; {=================================================================== 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; procedure SayHello( startX, startY : integer ); begin setrgbcolor( 1.0, 1.0, 1.0 ); moveto( startX, startY ); rlineto( 30, 80 ); rlineto( -10, 20 ); rlineto( 0, -100 ); rlineto( 10, 30 ); rlineto( 10, 0 ); rlineto( 10, -30 ); rlineto( 15, 0 ); rlineto( 10, 30 ); rlineto( 5, -20 ); rmoveto( -10, 40 ); rlineto( 0, 2 ); flushgraphics end; procedure SayHelloAgain; var greeting : string(20); begin setrgbcolor( 1, 0, 0 ); setfont( 1, 36 ); greeting := 'Howdy.'; displaytextxy( 350, 400, greeting ); setrgbcolor( 0, 1, 0 ); moveto( 380, 350 ); displaytext( greeting ); flushgraphics end; procedure DrawSomeCircles; begin setrgbcolor( 0, 0, 1 ); circle( 150, 250, 50 ); circlefilled( 350, 250, 50 ); flushgraphics end; {=================================================================== main program ===================================================================} begin StartGraphics; SayHello( 100, 490 ); SayHelloAgain; DrawSomeCircles; readln end.