program tin;
uses crt;
var i,diem,y,x,n,lv,life:integer;
b,a,h:char;ten:string;
label asds;
begin
asds:
clrscr;
textbackground(10);
gotoxy(35,20); write('Name: ');readln(ten);
clrscr;
for i:=1 to 80 do
begin
gotoxy(i,1);
write('#');
end;
for i:=1 to 103 do
begin
gotoxy(1,i);
write('#');
end;
for i:=1 to 25 do
begin
gotoxy(80,i);
write('#');
end;
a:=chr(random(25)+97);y:=1; x:=45;life:=3;lv:=1;n:=30000 div lv;
gotoxy(5,3);write('Point: ',diem);
gotoxy(5,5);write('Life: ',life);
gotoxy(5,7);write('Lv: ',lv);
gotoxy(5,9);write('Name: ',ten);
while (life>0) and (lv<>5) do
begin
if (y<25) then
begin
if keypressed then
Begin
b:=readkey;
if a=b then
begin
textcolor(red); delay(1000);
delay(1000); gotoxy(x,y); writeln(' ');
a:=chr(random(25)+97);
y:=1;
textcolor(white);
diem:=diem+1;gotoxy(5,3);write('Point: ',diem);
lv:=diem div 5;
gotoxy(5,7);write('LV: ',lv);
end
else
begin
if (b=#27) then exit;
if (b=#32) then
begin
gotoxy(10,22); writeln('Pause');readln;
gotoxy(10,22);writeln(' ');
end
else
begin
delay(5000); gotoxy(50,22);write('Wrong');
gotoxy(50,22);write(' ');
life:=life-1;
gotoxy(5,5);write('Life: ',life);
x:=45;y:=1;
gotoxy(x,y);write(a);
end;
end;
End;
gotoxy(x,y);writeln(a);
delay(n-1000*lv);
gotoxy(x,y);writeln(' ');
y:=y+1;
END
else
begin
gotoxy(50,22);writeln('-1');delay(1000);
gotoxy(50,22);writeln(' ');
life:=life-1;
gotoxy(5,5);write('Life: ',life);
x:=45;y:=1;
gotoxy(x,y);write(a);
end;
if(lv=5) then begin
gotoxy(20,22);write('You Win');
end;
if (life=0) then begin gotoxy(20,22);write('You Lose'); end;
end;
gotoxy(38,22); write('Enter to Try Again');
if readkey ='y' then goto asds;
clrscr;
readln
end.