home *** CD-ROM | disk | FTP | other *** search
- PROGRAM Fill_Circle;
-
- {$M 65520,0,655360} { Set stack allocation to maximum }
-
- uses
- Crt,GDriver,GKernel,Turbo3;
-
- {$I FILL.INC}
- {$I FLOOD.INC}
-
- { A demonstrator for Fill_Region and Flood_Fill. }
-
- { By Fred Robinson
- Monotreme Software Copyright (c) 1987 Monotreme Software
- 29766 Everett
- Southfield, MI 48076
- USA }
-
- VAR
- I: Integer;
- X, Y: Real;
- White: Boolean;
- Ch: Char;
-
- BEGIN
- Randomize;
- White := True;
- InitGraphic;
- DefineWorld (1, -1, -0.75, 1, 0.75);
- SelectWorld (1);
- SelectWindow (1);
- SetLineStyle (0);
-
- REPEAT
- IF White THEN
- SetColorWhite
- ELSE
- SetColorBlack;
-
- White := NOT White;
-
- FOR I := 1 TO 25 DO
- BEGIN
- SetAspect (2.25*Random);
- DrawCircle (2*Random-1, 1.5*Random-0.75, 1.5*Random)
- END (* FOR *);
-
- FOR I := 1 TO 10 DO
- BEGIN
- REPEAT
- X := Random * 2.0 - 1.0;
- Y := Random * 1.5 - 0.75
- UNTIL NOT PointDrawn (X, Y);
-
- Fill_Region (X, Y)
- { Flood_Fill (X, Y) } { Using Flood_Fill exhausts stack space }
- END (* FOR *)
- UNTIL KeyPressed;
-
- Read (Kbd, Ch);
- LeaveGraphic
- END.