program game; uses crt; var i,x,y, dy, dk:integer; ko:boolean; kiirus,kirjuta:integer; z,g,u,v:real; s:string; procedure printE; begin gotoxy(20, 5); writeln('***************'); gotoxy(20, 6); writeln('* *'); gotoxy(20, 7); writeln('* *'); gotoxy(20, 8); writeln('* *'); gotoxy(20, 9); writeln(' '); gotoxy(20, 10);writeln('* *'); gotoxy(20, 11);writeln('***************'); end; procedure printO; begin writeln('*'); end; begin textcolor(white); printE; dy:=8; dk:=1; repeat dy:=dy+dk; if dy<7 then dk:=1; if dy>9 then dk:=-1; textcolor(white); gotoxy(26, dy); write('$'); delay(100); textcolor(black); gotoxy(26, dy); write('$'); if keypressed then s:=readkey; if s=chr(0) then begin s:=readkey; textcolor(black); gotoxy(x, 9); write('*'); if(s='K')and(x>3) then x:=x-1; if(s='M')and(x<75)then x:=x+1; if(s='H')and(y>3) then y:=y-1; if(s='P')and(y<18) then y:=y+1; textcolor(white); gotoxy(x, 9); write('*'); end; until s=chr(27); { for i:=10 to 24 do begin textcolor(white); gotoxy(i,10); write('$'); delay(10); end;} { for x:=50 downto 1 do gotoxy(x,10); write('$'); delay(10); x:=25; y:=25; repeat if x<5 then kiirus:=abs(kiirus); if x>70 then kiirus:=-abs(kiirus); until keypressed; textcolor(0); gotoxy(i,100); write('$');} {end; textMode(LastMode); end;} begin printO; clrscr; x:=15; y:=10; kirjuta:=(x); kirjuta:=(y); writeln('*'); repeat s:=readkey; textcolor(white); kirjuta:=(x); kirjuta:=(y); if s=chr(0)then begin s:=readkey; if(s='K')and(x>3) then x:=x-1; if(s='M')and(x<75)then x:=x+1; if(s='H')and(y>3) then y:=y-1; if(s='P')and(y<18) then y:=y+1; end; textcolor(white); kirjuta:=(x); kirjuta:=(y); until s=chr(27); {end;} end; begin { if ko('$')=ko('*') then} if (x=26) and (dy=9) then writeln('Game over') end; end.