program liikumine; uses crt, graph; var x, y, kx, ky ,d, m: integer; s: string; koord:120..180; procedure joonista(x, y: integer); begin rectangle(103+x,103+y,113+x,113+y); end; begin clrscr; d:=detect; initgraph(d, m, ''); x:=15; y:=10; rectangle(100,100,400,400); line(round(500/2-300/8),round(500/2),round(500/2+300/8),round(500/2)); joonista(x, y); repeat s:=ReadKey; textcolor(black); joonista(x, y); if (y<>300/2-10) and (x<>koord) then begin if s=chr(0) then begin s:=readkey; if (s='K') and (x>3) then x:=x-1; if (s='M') and (x<284) then x:=x+1; if (s='H') and (y>3) then y:=y-1; if (s='P') and (y<284) then y:=y+1; end; end; textcolor(white); joonista(x,y); until s=chr(27); TextMode(LastMode); end.