{************************************************
                 Hugo Eti‚vant
     http://www.multimania.com/cyberzoide/
      e-mail : cyberzoide@multimania.com
      (pour une aide en Turbo Pascal 7.0)
*************************************************}

uses graph;

procedure tri(x,y,a:real; n:byte);
var h:real;
begin
h:=sqrt(sqr(a)-sqr(a/2));
if odd(n) then h:=-h;
moveto(round(x),round(y-2*h/3));
lineto(round(x-a/2),round(y+h/3));
lineto(round(x+a/2),round(y+h/3));
lineto(round(x),round(y-2*h/3));
if n>1 then
   begin
   tri(x,y-2*h/3,a/2,n-1);
   tri(x-a/2,y+h/3,a/2,n-1);
   tri(x+a/2,y+h/3,a/2,n-1);
   end;
end;

var vga,vgahi:integer;

BEGIN
initgraph(vga,vgahi,'c:\bp\bgi');
tri(getmaxx/2,getmaxy/2,100,10);
readln;
END.