Игра»Попади в центр мишени.
uses graph,crt-
vargd,gm,x,y:integer-
C:CHAR-
label 1-
begin
initgraph(gd,gm,’c:\-bp\-bgi’)-
setfillstyle(2,1)-
bar(220, 140,420,340)-
setfillstyle(4,9)-
bar(270, 190,370,290)-
outtextxy (30,0,’введите координаты(x и y через ENTER)’)-
outtextxy(30,10,’PressEsc to Exit’)-
1:c:=readkey-
if c=chr(27) thenhalt-
gotoxy(1,1)-
readln(x)-
gotoxy(1,2)-
readln(Y)-
putpixel(x, Y,12)-
IF (x <- 220) OR(x >- 420) OR (Y <- 140) OR (Y >- 340) THEN
begin
outtextxy(20,400,’0 очков’)-
GOTO 1-
end-
IF (x >-= 220)AND (x <- 420) AND (Y >-= 140) AND (Y <- 190) OR (x >-= 220) AND (x<- 420) AND (Y >-= 290) AND (Y <- 340) THEN
begin
outtextxy(20,400,’5 очков’)-
goto 1-
end-
IF (x >-= 270)AND (x <- 370) AND (Y >-= 190) AND (Y <- 290) THEN
outtextxy(20,400,’10 очков’)-
begin
GOTO 1-
if c=chr(27) then halt-
end-
end.