program dislin_patterns;

uses
   dislin;

var
   ctit	       : ansistring  = 'Shading Patterns (AREAF)';
   cstr	       : ansistring;
   nx, nl      : int32;
   ny, i, j    : int32;
   ii, k, iclr : int32;
   nx0	       : int32 = 335;
   ny0	       : int32 = 350;
   ixp	       : array[0..3] of int32;
   iyp	       : array[0..3] of int32;
   ix	       : array[0..3] of int32 = (0, 300, 300, 0);
   iy	       : array[0..3] of int32 = (0, 0, 400, 400);

begin
   SetLength (cstr, 80);  
   scrmod ('revers');
   metafl ('cons');
   disini ();
   pagera ();
   complx ();
   setvlt ('small');

   height (50);
   nl := nlmess (ctit);
   nx := (2970 - nl) div 2;
   messag (ctit, nx, 200);

   iclr := 0;
   for i := 0 to 2 do
   begin
      ny := ny0 + i * 600;
      for j := 0 to 5 do
      begin	 
	 nx := nx0 + j * 400;
	 ii := i * 6 + j;
	 nl := intcha (ii, cstr);
         shdpat (ii);

	 iclr := iclr mod 8;
	 iclr := iclr + 1;
         setclr (iclr);

	 for k := 0 to 3 do
         begin
	    ixp[k] := ix[k] + nx;
	    iyp[k] := iy[k] + ny;
	 end;   
         areaf  (@ixp[0], @iyp[0], 4);

         nl := nlmess (cstr);
         nx := nx + (300 - nl) div 2;
         messag (cstr, nx, ny + 460);
      end;
   end;
   disfin ();
end.


