{--------------------------------------------------------------}
{                          Patterns                            }
{                                                              }
{            Graphics pattern demonstration program            }
{                                                              }
{                             by Jeff Duntemann                }
{                             Turbo Pascal V3.0                }
{                             Last update 1/31/86              }
{                                                              }
{    From the book, COMPLETE TURBO PASCAL, by Jeff Duntemann   }
{    Scott, Foresman & Co. (c) 1986,1987  ISBN 0-673-18600-8   }
{--------------------------------------------------------------}

PROGRAM Patterns;

TYPE
  PatternArray = ARRAY[0..7] OF Byte;

CONST
  Halftone1 : PatternArray =
              ($CC,$33,$CC,$33,$CC,$33,$CC,$33);
  Halftone2 : PatternArray =
              ($AA,$55,$AA,$55,$AA,$55,$AA,$55);
  Squiggles : PatternArray =
              ($94,$84,$48,$30,$00,$c1,$22,$14);
  Vertical  : PatternArray =
              ($CC,$CC,$CC,$CC,$CC,$CC,$CC,$CC);
  Bricks    : PatternArray =
              ($01,$82,$44,$28,$10,$20,$40,$80);
  Blocks    : PatternArray =
              ($00,$3C,$42,$42,$42,$42,$3C,$00);


{$I GRAPH.P}

BEGIN
  GraphColorMode;
  Pattern(Halftone1);
  FillPattern(0,0,106,100,1);
  Pattern(Halftone2);
  FillPattern(107,0,213,100,2);
  Pattern(Squiggles);
  FillPattern(213,0,319,100,3);
  Pattern(Vertical);
  FillPattern(0,101,106,199,3);
  Pattern(Bricks);
  FillPattern(106,101,213,199,2);
  Pattern(Blocks);
  FillPattern(213,101,319,199,1);
  Readln;
  TextMode;
END.
