program Text;

uses mode13h,crt,sprites;

var image:array [1..29] of pointer;

procedure appearline (color,vertline:integer);
var a:integer;
begin
     for a:=0 to 159 do
         begin
              delay (3);
              putpixel (159+a,vertline,color,vga);
              putpixel (159-a,vertline,color,vga);
         end;
end;

procedure setcolors;
var a:integer;
begin
     loadpcx ('font.dat',vp[1]);
     for a:=1 to 29 do
         begin
              getimage (5*a-5,0,5*a-1,5,image[a],vp[1]);
         end;
     setcolor (1,10,0,10);
     setcolor (2,20,0,20);
     setcolor (3,30,0,30);
     setcolor (4,40,0,40);
     setcolor (5,50,0,50);
     setcolor (6,0,10,10);
     setcolor (7,0,20,20);
     setcolor (8,0,30,30);
     setcolor (9,0,40,40);
     setcolor (10,0,50,50);
end;

procedure init;
begin
     initgraph;
     initvirt;
end;

procedure terminate;
var a:integer;
begin
     for a:=1 to 29 do killimage(image[a]);
     closegraph;
     closevirt;
     textcolor (5);
     writeln ('Crush logging off...');
     writeln ('..');
     writeln ('.');
end;

procedure purplebit;
begin
     appearline (1,30);
     appearline (2,31);
     appearline (3,32);
     appearline (4,33);
     appearline (5,34);
     appearline (5,35);
     appearline (4,36);
     appearline (3,37);
     appearline (2,38);
     appearline (1,39);
end;

procedure greenbit;
begin
     appearline (6,160);
     appearline (7,161);
     appearline (8,162);
     appearline (9,163);
     appearline (10,164);
     appearline (10,165);
     appearline (9,166);
     appearline (8,167);
     appearline (7,168);
     appearline (6,169);
end;

procedure write01;
begin
     putimage (130,20,image[8],vga);
     delay(50);
     putimage (136,20,image[9],vga);
     delay(50);
     putimage (146,20,image[20],vga);
     delay(50);
     putimage (152,20,image[8],vga);
     delay(50);
     putimage (158,20,image[5],vga);
     delay(50);
     putimage (163,20,image[18],vga);
     delay(50);
     putimage (168,20,image[5],vga);
     delay(50);
     putimage (173,20,image[27],vga);
     delay(50);
end;

procedure write02;
begin
     putimage (50,60,image[3],vga);
     delay(50);
     putimage (55,60,image[1],vga);
     delay(50);
     putimage (61,60,image[14],vga);
     delay(50);
     putimage (72,60,image[25],vga);
     delay(50);
     putimage (78,60,image[15],vga);
     delay(50);
     putimage (83,60,image[21],vga);
     delay(50);
     putimage (94,60,image[12],vga);
     delay(50);
     putimage (99,60,image[15],vga);
     delay(50);
     putimage (104,60,image[1],vga);
     delay(50);
     putimage (110,60,image[4],vga);
     delay(50);
     putimage (120,60,image[13],vga);
     delay(50);
     putimage (126,60,image[5],vga);
     delay(50);
     putimage (132,60,image[28],vga);
     delay(50);
end;

procedure write03;
begin
     putimage (100,80,image[19],vga);
     delay(50);
     putimage (105,80,image[9],vga);
     delay(50);
     putimage (109,80,image[13],vga);
     delay(50);
     putimage (119,80,image[3],vga);
     delay(50);
     putimage (124,80,image[9],vga);
     delay(50);
     putimage (128,80,image[20],vga);
     delay(50);
     putimage (134,80,image[25],vga);
     delay(50);
end;

procedure write04;
begin
     putimage (100,90,image[16],vga);
     delay(50);
     putimage (105,90,image[9],vga);
     delay(50);
     putimage (109,90,image[14],vga);
     delay(50);
     putimage (115,90,image[2],vga);
     delay(50);
     putimage (120,90,image[1],vga);
     delay(50);
     putimage (126,90,image[12],vga);
     delay(50);
     putimage (131,90,image[12],vga);
     delay(50);
     putimage (140,90,image[4],vga);
     delay(50);
     putimage (145,90,image[18],vga);
     delay(50);
     putimage (150,90,image[5],vga);
     delay(50);
     putimage (155,90,image[1],vga);
     delay(50);
     putimage (161,90,image[13],vga);
     delay(50);
     putimage (167,90,image[19],vga);
     delay(50);
end;

procedure write05;
begin
     putimage (100,100,image[29],vga);
     delay(50);
     putimage (106,100,image[4],vga);
     delay(50);
     putimage (116,100,image[2],vga);
     delay(50);
     putimage (121,100,image[15],vga);
     delay(50);
     putimage (126,100,image[24],vga);
     delay(50);
     putimage (132,100,image[5],vga);
     delay(50);
end;

procedure write06;
begin
     putimage (120,120,image[20],vga);
     delay(50);
     putimage (126,120,image[8],vga);
     delay(50);
     putimage (132,120,image[1],vga);
     delay(50);
     putimage (138,120,image[14],vga);
     delay(50);
     putimage (144,120,image[24],vga);
     delay(50);
     putimage (155,120,image[2],vga);
     delay(50);
     putimage (160,120,image[18],vga);
     delay(50);
     putimage (165,120,image[1],vga);
     delay(50);
     putimage (171,120,image[9],vga);
     delay(50);
     putimage (175,120,image[14],vga);
     delay(50);
     putimage (186,120,image[16],vga);
     delay(50);
     putimage (191,120,image[15],vga);
     delay(50);
     putimage (196,120,image[23],vga);
     delay(50);
     putimage (202,120,image[5],vga);
     delay(50);
     putimage (208,120,image[18],vga);
     delay(50);
     putimage (213,120,image[27],vga);
     delay(50);
end;

begin
init;
setcolors;
purplebit;
greenbit;
write01;
delay (200);
write02;
write03;
delay (200);
write04;
delay (200);
write05;
delay (200);
write06;
readln;
terminate;
end.
