program Noname7; uses crt; var ox : array[1..100]of integer; oy : array[1..100]of integer; a,b,c,d,e,x,y,i,j,score: integer; z:char; die:boolean; procedure border; var x,y,w,h : integer; i,j:integer; begin x:=5; y:=5; w:=60; h:=20; for i := 1 to w do begin write('-'); end; writeln(); for i := 1 to h do begin write('|'); for j:=1 to w-2 do write(' '); writeln('|'); end; for i := 1 to w do; begin write('-'); end; end; begin randomize(); border; CursorOff; x:=2; y:=2; a:=1; b:=0; j:=0; score :=0; repeat c:=random(80)+1; d:=random(25)+1; until (c<58)and (c>1) and (d>1) and(d<18); gotoxy(c,d); write('O'); for i := 1 to 100 do begin repeat ox[i]:=random(80)+1; oy[i]:=random(25)+1; until (ox[i]<58)and (ox[i]>1) and (oy[i]>1) and(oy[i]<18); end; repeat repeat gotoxy(x,y); write('Q'); if (x=c) and (y=d) then begin repeat c:=random(80)+1; d:=random(25)+1; until (c<58)and (c>1) and (d>1) and(d<18); gotoxy(c,d); write('O'); gotoxy(58,25); score:=score+1; write('Score:',score); j:=j+1; gotoxy(ox[j],oy[j]); write('?'); end; delay(100); gotoxy(x,y); write(' '); x := x+a; y := y+b; if (x=60) or (y=20) then begin die := true; end; until keypressed or die = true; z := readkey; if (z='s') and (b<>-1) then begin b:=1; a:=0; end; if (z='w') and (b<>1) then begin b:=-1; a:=0; end; if (z='a') and (a<>1) then begin a:=-1; b:=0; end; if (z='d') and (a<>-1) then begin a:=1; b:=0; end; until false or die = true; if die=true then write('Game over!'); readln(); end.