uses crt,graph;
var xc,yc,x,y,dx,dy,w:integer;
begin
clrscr;
repeat
clrscr;
writeln('Napravlenie dvizenya:');
writeln('1 - po gorizontali');
writeln('2 - po vertikali');
writeln('3- s gorki');
writeln('4 - vyhod');
repeat
readln(w);
until w in [1..4];
xc:=0;
initgraph(xc,yc,'');
case w of
1:begin
xc:=10;
yc:=getmaxY div 2;
repeat
setcolor(12);
circle(xc,yc,2);
delay(50);
setcolor(0);
circle(xc,yc,2);
xc:=xc+5;
until xc>getmaxX-15;
setcolor(12);
circle(xc,yc,2);
readln;
restorecrtmode;
end;
2:begin
xc:=getmaxX div 2;
yc:=20;
repeat
setcolor(12);
circle(xc,yc,2);
delay(50);
setcolor(0);
circle(xc,yc,2);
yc:=yc+5;
until yc>getmaxY-15;
setcolor(12);
circle(xc,yc,2);
readln;
restorecrtmode;
end;
3:begin
xc:=10;
yc:=10;
repeat
setcolor(12);
circle(xc,yc,2);
delay(50);
setcolor(0);
circle(xc,yc,2);
xc:=xc+4;
yc:=yc+3;
until (xc>getmaxX-15)or(yc>getmaxY-15);
setcolor(12);
circle(xc,yc,2);
readln;
restorecrtmode;
end;
4:exit;
end;
until w=4;
end.