Uses GraphABC;
begin
Window.Height:=600;
Window.Width:=800;
var y:=10;
while y Line(10,y,790,y);
y+=10
end;
var x:=10;
while x Line(x,10,x,590);
x+=10
end;
Randomize;
Pen.Color:=clRed;
Pen.Width:=3;
x:=Window.Width div 2;
x:=10*Round(x/10);
y:=Window.Height div 2;
y:=10*Round(y/10);
MoveTo(x,y);
repeat
case Random(1,4) of
1:LineTo(PenX+10,PenY);
2:LineTo(PenX,PenY-10);
3:LineTo(PenX-10,PenY);
4:LineTo(PenX,PenY+10);
end;
Sleep(100);
until false;
end.