Acasa Tehnologie Carpeta

Carpeta

by Dragos Schiopu

>

uses Graph;
type trect = record
             x,y:integer;
             end;
var
 grDriver: Integer;
 grMode: Integer;
 ErrCode: Integer;
 s:string;
procedure d(x,y,h,k:integer);
var r:trect;
begin

  r.x := x+h div 3;
  r.y := y+h div 3;
 

  rectangle(r.x,r.y,r.x+h div 3,r.y+h div 3);

  if (k>1) then
  begin

  d(x,y,h div 3,k-1);
  d(x+h div 3,y,h div 3,k-1);
  d(x+h - h div 3,y,h div 3,k-1);
  d(x+h - h div 3,y+h div 3,h div 3,k-1);
  d(x+h - h div 3,y+h - h div 3,h div 3,k-1);
  d(x+h div 3,y + h - h div 3,h div 3,k-1);
  d(x,y+h - h div 3, h div 3, k-1);
  d(x,y+h div 3,h div 3,k-1);
  end;
end;
begin

 grDriver := Detect;
 InitGraph(grDriver, grMode,' ');

   SetColor(15); 
   d(80,0,500,7);


   Readln; 
   CloseGraph; 
end.
{by Demonaz  PascalZone.evonet.ro}

s-ar putea sa-ti placa