tasks a-s
This commit is contained in:
parent
47bf37c096
commit
b83f433714
12433 changed files with 156208 additions and 123 deletions
43
Task/Dragon-curve/Pascal/dragon-curve-1.pascal
Normal file
43
Task/Dragon-curve/Pascal/dragon-curve-1.pascal
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.pascal
Normal file
8
Task/Dragon-curve/Pascal/dragon-curve-2.pascal
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