Паскаль. Прога не идет, подскажите в чем ошибка. Вот код.
Прога не идет, подскажите в чем ошибка. Вот код. Хочу чтобы красный кружочек можно было двигать при помощи клавиатуры
uses graph,crt;
var u,ou:pointer; ch: char; curx, cury, curx0, cury0, lx, ly, hx, hy: integer;
size: word;
procedure graphinterface;
var gd, gm, error: integer;
begin
gd:=detect;
initgraph( gd, gm, '');
error:=graphresult;
if error<>grok then
begin
writeln(grapherrormsg(error));
halt(error)
end
end;
begin
graphinterface;
hx:=5;
hy:=5;
lx:=100;
ly:=100;
size:=imagesize(0,0,lx,ly);
getmem(u, size); getmem(ou,size);
setcolor(4);
setfillstyle(1,4);
circle(lx+20,ly+20);
floodfill( lx+20,ly+20, 4);
getimage(100,100,lx+20,ly+20,ou^);
curx:=0;
cury:=0;
getimage(0,0,lx,ly,u^);
repeat
ch:=readkey;
if ord(ch)=0 then
begin
ch:= readkey;
curx0:=curx; cury0:=cury;
case ord(ch) of
77: if curx
then curx:=curx-hx;
72:if cury>hy
then cury:=cury-hy;
80: if cury
then begin
putimage( curx0, cury0, ou^, 0);
getimage( curx, cury, curx+lx, cury+ly, ou^);
putimage (curx,cury, u^,0);
end
end;
until ord(ch)=27;
readln;
closegraph;
end.