unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ExtCtrls, UTurtle, StdCtrls;
type
TForm1 = class(TForm)
Button1: TButton;
Turtle1: TTurtle;
procedure Button1Click(Sender: TObject);
private
{ Private-Deklarationen }
public
{ Public-Deklarationen }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
var n:integer;
procedure male (n,länge:integer);
begin
if n=1 then tturtle.draw(länge div 3)
else male(n-1,länge div 3);
tturtle.turn(300);
if n=1 then tturtle.draw(länge div 3)
else male(n-1,länge div 3);
tturtle.turn(120);
if n=1 then tturtle.draw(länge div 3)
else male(n-1,länge div 3);
tturtle.turn(300);
if n=1 then tturtle.draw(länge div 3)
else male(n-1,länge div 3);
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
n:=5;
male(4,1000)
end;
end.