uses graph,crt;
const
 numvert=14;
Type TTree = array [1..numvert*2] of word;
Const
 TREE: TTree = (0,0, 10,3, 12,0, 14,4, 24,0, 14,6, 14,40, 35,70,
                13,45, 12,80, 11,45 ,0,60, 10,40, 10,6);
Procedure Write_Cool_Tree(x,y,scale,color:word);
var
  i: word;
  tr : TTree;
begin
  for i := 0 to numvert-1 do
   begin
     tr[2*i+1] := (x+tree[2*i+1]*scale);
     tr[2*i+2] := (y-tree[2*i+2]*scale);
   end;
  SEtFillStyle(SolidFill,color);
  SetColor(color);
  FillPoly(numvert,TR);

  setcolor(green);
  for i := 1 to random(100) do begin
  moveto(tr[19],tr[20]);
  LineRel(Random(30*scale)-15*scale,Random(30*scale)-15*scale);
  end;
  for i := 1 to random(100) do begin
  moveto(tr[15],tr[16]);
  LineRel(Random(30*scale)-15*scale,Random(30*scale)-15*scale);
  end;
  for i := 1 to random(50) do begin
  moveto(tr[23],tr[24]);
  LineRel(Random(30*scale)-15*scale,Random(30*scale)-15*scale);
  end;
end;
{-----------------}
var
 grDriver: Integer;
 grMode: Integer;
 ErrCode: Integer;
 i,x2,y2,s2 : word;

begin
 grDriver := Detect;
 InitGraph(grDriver, grMode,' ');
 ErrCode := GraphResult;
 if ErrCode <> grOk then
  begin
    WriteLn('Setting graphics mode error');
    Halt(1);
  end;
 randomize;
 for i:=1 to random(19)+1 do
  begin
    s2:= 1;
    x2 := random(640-35*s2);
    y2 := 120;
    Write_COOL_TREE(x2,y2+random(10),s2,random(15));
  end;

 for i:=1 to random(15)+1 do
  begin
    s2:= 2;
    x2 := random(640-35*s2);
    y2 := 230;
    Write_COOL_TREE(x2,y2+random(10),s2,random(15));
  end;

 for i:=1 to random(8)+1 do
  begin
    s2:= 3;
    x2 := random(640-35*s2);
    y2 := 350;
    Write_COOL_TREE(x2,y2+random(10),s2,random(15));
  end;

 for i:=1 to random(5)+1 do
  begin
    s2:= 4;
    x2 := random(640-35*s2);
    y2 := 470;
    Write_COOL_TREE(x2,y2+random(10),s2,random(15));
  end;

 ReadKey;
 CloseGraph;
END.