gotoxy(10,6);
if z=2 then begin textcolor(6); write('Zivot: 100%'); end;
if z=1 then begin textcolor(4); write('Zivot: 50%'); end;
{prostredie}
if c=1 then begin gotoxy(19,9); textcolor(4); write(chr(3));end;
if e=1 then begin gotoxy(21,9); textcolor(6); write(chr(5));end;
if i=1 then begin gotoxy(43,15); textcolor(6); write(chr(5));end;
if j=1 then begin gotoxy(25,15);textcolor(6); write(chr(5));end;
gotoxy(10,10);
textcolor(2);
write(chr(219),chr(219),chr(219),chr(219),chr(219),' ',chr(219));
textcolor(0);write(chr(30));
textcolor(2);
for d:=1 to 7 do write(chr(219));
gotoxy(22,9); write(chr(219));
gotoxy(7,13);
for d:=1 to 23 do write(chr(219));
textcolor(1);
gotoxy(7,12);write(chr(176));gotoxy(45,15); write(chr(176));
gotoxy(25,18);write(chr(176));
gotoxy(18,12);write(chr(219));
textcolor(2);
gotoxy(7,16);
for d:=1 to 5 do write(chr(219));textcolor(0);write(chr(30));
textcolor(2); for d:=1 to 10 do write(chr(219));write(' ');
for d:=1 to 6 do write(chr(219));
for d:=1 to 11 do write(chr(219));
for d:=1 to 5 do write(chr(219));
gotoxy(29,15); write(chr(219));gotoxy(29,14); write(chr(219));
gotoxy(7,19);
for d:=1 to 40 do write(chr(219));
textcolor(a);
gotoxy(x,y);
write ('');
readkey;
h:=readkey;
if (h='M') then begin g:=x; x:=x+1; end;
if (h='K') then x:=x-1;
if (h=#81) then skokp;
if (h=#83) then skokl;
if ((x=15) and (y=9)) then pad;
if ((x=17) and (y=9)) then smrt;
if ((x=19) and (y=9)) then zivot1;
if ((x=21) and (y=9)) then kluc1;
if ((x=22) and (y=9)) then x:=g;
if ((x=25) and (y=9)) then pad;
if ((x=26) and (y=9)) then pad;
if ((x=18) and (y=12)) then vitaz;
if ((x=7) and (y=12)) then begin x:=10; y:=9; end;
if ((x=9) and (y=9)) then pad;
if ((x=8) and (y=9)) then pad;
if ((x=30) and (y=12)) then pad;
if ((x=31) and (y=12)) then pad;
if ((x=12) and (y=15)) then smrt;
if ((x=23) and (y=15)) then pad;
if ((x=43) and (y=15)) then kluc2;
if ((x=45) and (y=15)) then begin x:=8; y:=15; end;
if ((x=25) and (y=15)) then kluc3;
if ((x=25) and (y=18)) then begin x:=10; y:=9; end;
if ((x=29) and (y=15)) then x:=g;
until ((h=#27) or (z=0) or (v=1));
clrscr;
textcolor(1);
gotoxy(20,20);
if z=0 then writeln ('GAME OVER');
if v=1 then writeln ('VITAZSTVO');
delay(2000);