PROGRAM PASSWORD(input,output);
uses
crt,Graph;
var
grDriver : Integer;
grMode : Integer;
indice:integer;
t,a,b:real;
k:integer;
(*************************************************************************)
function POT(fpa,fpb:real):real;
var
fpc,fpe:integer;
fpd:real;
begin
fpe:=trunc(fpb);
fpd:=1;
for fpc:=1 to fpe do
fpd:=fpd*fpa;
pot:=fpd
end;
function sgn(fs:real):integer;
begin
if fs<>0 then
sgn:=trunc(fs/(abs(fs)))
else
sgn:=1
end;
function fraz(ff:real):real;
begin
fraz:=ff-trunc(ff)
end;
procedure codice;
var
spazio,indice,conta,ch:integer;
lettera:array[1..20] of char;
a,b:integer;
begin
spazio:=250;
indice:=0;
outtextxy(100,100,'D I M M I I L C O D I C E D I A C E S S O');
lettera:=' ';
repeat
ch:=ord(readkey);
if (ch=8) then
begin
if (indice>0) then
begin
indice:=indice-1;
ch:=32;
setcolor(0);
outtextxy(spazio,200,char(219));
setcolor(15);
spazio:=spazio-10;
end
end
else
if (ch<>0) and (ch<>13) then
begin
indice:=indice+1;
spazio:=spazio+10;
lettera[indice]:=char(ch);
outtextxy(spazio,200,char(ch));
end
until ch=13;
if lettera<>'marcello ' then
begin
for b:=1 to 3 do
begin
for a:=500 to 600 do
begin
sound(a);
delay(1)
end;
for a:=600 downto 500 do
begin
sound(a);
delay(1)
end
end;
nosound;
halt;
end;
end;
begin
grDriver := Detect;
InitGraph(grDriver,grMode,'');
codice;
outtextxy(225,300,'accesso consentito');
readLn;
CloseGraph
end.