Category : Pascal Source Code
Archive   : TURTLE.ZIP
Filename : TURDEMO.PAS

 
Output of file : TURDEMO.PAS contained in archive : TURTLE.ZIP
uses
Graph,Turtle,Crt;

var
GDriver,GMode,MaxColors: integer;
Tortoise: GTurtle;

procedure Initialize;
begin
GDriver := detect;
InitGraph(GDriver,GMode,'');
MaxColors := GetMaxColor+1;
end;

procedure PrintPause;
var
ch: char;
begin
OutTextXY(10,10,'Press any key to continue');
while KeyPressed do ch := ReadKey;
ch := ReadKey;
end;

procedure TurtleHexDemo;
var
i,j: integer;
begin
with Tortoise do
begin
TDelay(10);
SetHeading(South);
PenUp;
Forwd(100);
delay(500);
TDelay(0);
PenDown;
SetHeading(45);
for i := 1 to 15 do
begin
SetPenColor(i);
for j := 1 to 6 do
begin
ForWd(100+i*3);
TurnRight(59);
end;
end;
Home;
end;
end;

procedure TurtleDiamondDemo;
var
i,j: integer;
begin
with Tortoise do
begin
Clear;
Wrap;
SetPosition(-100,-100);
SetHeading(45);
for i := 1 to 15 do
begin
SetPenColor(i);
for j := 1 to 3 do
begin
Forwd(200);
TurnLeft(90);
end;
Forwd(200);
end;
Home;
end;
end;

procedure TurtleWrite(x,y,scale,color: integer;workstr: string);
const
logostr: string[125] =
'pcma8a8b2c8c8c8e8e8f2g8g8g8a8a8c8c8c8'+
'f2g0g0e5b2c0c0a5f2e3g9g9a3g2e5c7c8c7'+
'f2g0g0e5b2c0c0a5f2e3g9g9a3g2e5c8c8c8pcd';

var
i: integer;
begin
with Tortoise do
begin
if color <= MaxColors then SetPenColor(color);
if scale <= 0 then scale := 1;
SetPosition(x,y);
for i := 1 to ord(WorkStr[0]) do
begin
if color < 0 then
SetPenColor(random(MaxColors)+1);
case WorkStr[i] of
' ': DrawStr(scale,'pc6');
'e': DrawStr(scale,'pbama6b2c4d2e2f2g4edc3bcef2g4'+
'h2pb2a3mbc2dfg2hpd7');
'i': DrawStr(scale,'pcma9bpamhabdefpemde9g2pc3');
'l': DrawStr(scale,'pbma7a7bde7e7fhpdc2');
'r': DrawStr(scale,'pcma9bce2b2c2d2eghg2f2e6g2pc9');
't': DrawStr(scale,'pb2cma8g3hbc3a3bde3c3dfg3e7dc'+
'dfg2h2pd2c5');
'u': DrawStr(scale,'pbama7bde6dc2ba6bde7deghfg4h2pd2c7');
'w': DrawStr(scale,'pbama7bde6dc2ba3bde3dc2ba6bde'+
'7f2g4hfg4h2pd2c6c7');
'h': DrawStr(scale,'pcma9a6bde7b2c2d3e7fha5hg2f2e5g2pc9');
(** Rest of the letters go here **)
end;
end;
DrawStr(scale,logostr);
end;
end;

procedure TurtleWriteDemo;
begin
with Tortoise do
begin
NoWrap;
Clear;
PenUp;
randomize;
TDelay(10);
TurtleWrite(-300,-110,5,MaxColors,'h');
{ TurtleWrite(-300,-110,5,MaxColors,'turtle write');
TDelay(7);
TurtleWrite(-300,-20,4,random(MaxColors)+1,'write turtle');
TDelay(5);
TurtleWrite(-300,55,3,-1,'turtle write');
TDelay(3);
TurtleWrite(-300,110,2,-1,'write turtle');
TDelay(1);
TurtleWrite(-300,150,0,MaxColors,'turtle write turtle write '+
'turtle write turtle write turtle');}
Home;
end;
end;

begin
Initialize;
Tortoise.Init;
Tortoise.Show;
{ TurtleHexDemo;
PrintPause;
TurtleDiamondDemo;
PrintPause;}
TurtleWriteDemo;
PrintPause;
CloseGraph;
end.


  3 Responses to “Category : Pascal Source Code
Archive   : TURTLE.ZIP
Filename : TURDEMO.PAS

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/