Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
43
Task/Dragon-curve/Pascal/dragon-curve-1.pas
Normal file
43
Task/Dragon-curve/Pascal/dragon-curve-1.pas
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
procedure dcr(step,dir:integer;length:real);
|
||||
begin;
|
||||
step:=step -1;
|
||||
length:= length/sqrt(2);
|
||||
if dir > 0 then
|
||||
begin
|
||||
if step > 0 then
|
||||
begin
|
||||
turnright(45);
|
||||
dcr(step,1,length);
|
||||
turnleft(90);
|
||||
dcr(step,0,length);
|
||||
turnright(45);
|
||||
end
|
||||
else
|
||||
begin
|
||||
turnright(45);
|
||||
forward(length);
|
||||
turnleft(90);
|
||||
forward(length);
|
||||
turnright(45);
|
||||
end;
|
||||
end
|
||||
else
|
||||
begin
|
||||
if step > 0 then
|
||||
begin
|
||||
turnleft(45);
|
||||
dcr(step,1,length);
|
||||
turnright(90);
|
||||
dcr(step,0,length);
|
||||
turnleft(45);
|
||||
end
|
||||
else
|
||||
begin
|
||||
turnleft(45);
|
||||
forward(length);
|
||||
turnright(90);
|
||||
forward(length);
|
||||
turnleft(45);
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
8
Task/Dragon-curve/Pascal/dragon-curve-2.pas
Normal file
8
Task/Dragon-curve/Pascal/dragon-curve-2.pas
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
begin
|
||||
init;
|
||||
penup;
|
||||
back(100);
|
||||
pendown;
|
||||
dcr(step,direction,length);
|
||||
close;
|
||||
end.
|
||||
Loading…
Add table
Add a link
Reference in a new issue