Вообще не знаю каким способом делать эту задачу.
Условие прилагается. Подскажите пожалуйста, как это всё реализовать.
cx := GetMaxX div 2;
cy := GetMaxY div 2;
angle := 180;
readkey;
while (angle >= 0) do begin
SetFillStyle(SolidFill, Black);
FillEllipse(cx, cy, r, r);
SetFillStyle(SolidFill, White);
Sector(cx, cy, angle, angle + 180, r, r);
delay(100);
angle := angle - 1;
end;
uses crt, graph;
const
r = 100;
cx: Integer = 0;
cy: Integer = 0;
var
gd, gm: Integer;
angle, T, CA, CB: Integer;
ch: Char;
begin
gd := detect;
initgraph(gd, gm, '');
cx := GetMaxX div 2;
cy := GetMaxY div 2;
angle := 180;
CA := White;
CB := Black;
SetFillStyle(SolidFill, CA);
Sector(cx, cy, 0, 180, r, r);
SetFillStyle(SolidFill, CB);
Sector(cx, cy, 180, 360, r, r);
repeat
ch := #0;
angle := 0;
while (ch = #0) and (angle < 180) do begin
SetColor(CB);
SetFillStyle(SolidFill, CB);
Sector(cx, cy, angle, angle + 12, r, r);
SetColor(white);
Circle(cx, cy, r);
SetColor(CA);
SetFillStyle(SolidFill, CA);
Sector(cx, cy, angle + 180, angle + 192 , r, r);
inc(angle, 12);
while keypressed do ch := readkey;
delay(50);
end;
T := CA; CA := CB; CB := T;
until ch <> #0;
closegraph;
end.
procedure disk(f:real; r:integer) ;
var r2:integer;
begin
r2:=r+1;
arc(0,0,round(180+180*f/pi)-1,round(360+180*f/pi)+1,r);
arc(0,0,round(180*f/pi-1),round(46+180*f/pi),r-5);
arc(0,0,round(180*f/pi-1),round(46+180*f/pi),r-11);
arc(0,0,round(44+180*f/pi),round(91+180*f/pi),r-16);
arc(0,0,round(44+180*f/pi),round(91+180*f/pi),r-22);
arc(0,0,round(89+180*f/pi),round(136+180*f/pi),r-27);
arc(0,0,round(89+180*f/pi),round(136+180*f/pi),r-33);
arc(0,0,round(134+180*f/pi),round(181+180*f/pi),r-38);
arc(0,0,round(134+180*f/pi),round(181+180*f/pi),r-44);
line(round(r2*cos(pi+f)),-round(r*sin(pi+f)),round(r*cos(2*pi+f)),-round(r*sin(2*pi+f)));
line(round((r-4)*cos(pi/4+f)),-round((r-4)*sin(pi/4+f)),round((r-11)*cos(pi/4+f)),-round((r-11)*sin(pi/4+f)));
line(round((r-16)*cos(pi/4+f)),-round((r-16)*sin(pi/4+f)),round((r-22)*cos(pi/4+f)),-round((r-22)*sin(pi/4+f)));
line(round((r-16)*cos(pi/2+f)),-round((r-16)*sin(pi/2+f)),round((r-22)*cos(pi/2+f)),-round((r-22)*sin(pi/2+f)));
line(round((r-27)*cos(pi/2+f)),-round((r-27)*sin(pi/2+f)),round((r-33)*cos(pi/2+f)),-round((r-33)*sin(pi/2+f)));
line(round((r-27)*cos(3*pi/4+f)),-round((r-27)*sin(3*pi/4+f)),round((r-33)*cos(3*pi/4+f)),-round((r-33)*sin(3*pi/4+f)));
line(round((r-38)*cos(3*pi/4+f)),-round((r-38)*sin(3*pi/4+f)),round((r-44)*cos(3*pi/4+f)),-round((r-44)*sin(3*pi/4+f)));
setfillstyle(1,1);
floodfill(round(r/2*cos(3*pi/2+f)),-round(r/2*sin(3*pi/2+f)),1);
floodfill(round((r-8)*cos(pi/6+f)),-round((r-8)*sin(pi/6+f)),1);
floodfill(round((r-20)*cos(pi/3+f)),-round((r-20)*sin(pi/3+f)),1);
floodfill(round((r-30)*cos(2*pi/3+f)),-round((r-30)*sin(2*pi/3+f)),1);
floodfill(round((r-40)*cos(5*pi/6+f)),-round((r-40)*sin(5*pi/6+f)),1);
end;
uses graph;
procedure disk(f: real; r:integer);
const delta = 6;
procedure put_arc(start, finish: integer;
var r_out: integer);
var
xs_in, ys_in, xf_in, yf_in: integer;
arc_coords: arccoordstype;
begin
arc(0, 0, round(start + f),round(finish + f), r_out);
getarccoords(arc_coords);
with arc_coords do begin
xs_in := xstart; ys_in := ystart;
xf_in := xend; yf_in := yend;
end;
dec(r_out, delta);
arc(0, 0, round(start + f), round(finish + f), r_out);
getarccoords(arc_coords);
with arc_coords do begin
line(xs_in, ys_in, xstart, ystart);
line(xf_in, yf_in, xend, yend);
end;
end;
begin
arc(0,0,round(180+180*f/pi)-1,round(360+180*f/pi)+1,r);
dec(r, 16);
put_arc(135, 180, r);
put_arc(90, 135, r);
put_arc(45, 90, r);
put_arc(0, 45, r);
end;
var gd, gm: integer;
begin
initgraph(gd, gm, '');
setviewport(getmaxx div 2, getmaxy div 2, getmaxx, getmaxy, false);
disk(0, 50);
readln;
closegraph;
end.
uses graph,crt;
const r = 100; d = 9000 ; df = pi/50;
var f:real; i , k:integer ;
Procedure disk(f:real;r:integer); {ваша процедура}
const delta=6;
procedure put_arc(start,finish:integer; var r_out:integer);
var xs_in,ys_in,xf_in,yf_in,r2:integer;
arc_coords:arccoordstype;
begin
r2:=r+1;
arc(0,0,round(start+f),round(finish+f),r_out);
getarccoords(arc_coords);
with arc_coords do begin
xs_in:=xstart;ys_in:=ystart;
xf_in:=xend;yf_in:=yend;
end;
dec(r_out,delta);
arc(0,0,round(start+f),round(finish+f),r_out);
getarccoords(arc_coords);
with arc_coords do begin
line(xs_in,ys_in,xstart,ystart);
line(xf_in,yf_in,xend,yend);
end;
end;
begin
arc(0,0,round(180+180*f/pi)-1,round(360+180*f/pi)+1,r);
dec(r,16);
put_arc(135,180,r);
put_arc(90,135,r);
put_arc(45,90,r);
put_arc(0,45,r);
end;
begin
init;{инициализация граф режима}
setbkcolor(15);
setpalette(1,0);
setviewport(getmaxx div 2,getmaxy div 2,getmaxx,getmaxy,false);
f:=2*pi;
k:=1;
i:=0;
repeat
if (i=100) or (i=-100) then begin f:=2*pi; i:=0 end;
setcolor(1);
disk(f,r); {изменила параметры}
delay(d);
setcolor(15);
setfillstyle(1,15);
fillellipse(0,0,r+1,r+1);
if keypressed then
if readkey=#0 then
case ord(readkey) of
59: k:=-1;
68: k:=1;
79: halt;
end;
i:=i+k;
f:=f+df*k;
until false;
end.
uses graph,crt;
const r = 100; d = 9000 ; df = pi/50;
var f:real; i , k:integer ;
begin
init;
setbkcolor(15);
setpalette(1,0);
setviewport(getmaxx div 2,getmaxy div 2,getmaxx,getmaxy,false);
f:=2*pi;
k:=1;
i:=0;
repeat
if (i=100) or (i=-100) then begin f:=2*pi; i:=0 end;
setcolor(1);
disk(f,r);
delay(8000);
setcolor(15);
setfillstyle(1,15);
fillellipse(0,0,r+1,r+1);
if keypressed then
if readkey=#0 then
case ord(readkey) of
59: k:=-1;
68: k:=1;
79: halt;
end;
i:=i+k;
f:=f+df*60*k;
until false;
end.
uses graph, crt;
procedure disk(f: real; r:integer);
const delta = 6;
procedure put_arc(start, finish: integer;
var r_out: integer);
var
xs_in, ys_in, xf_in, yf_in: integer;
arc_coords: arccoordstype;
begin
arc(0, 0, round(start + f),round(finish + f), r_out);
getarccoords(arc_coords);
with arc_coords do begin
xs_in := xstart; ys_in := ystart;
xf_in := xend; yf_in := yend;
end;
dec(r_out, delta);
arc(0, 0, round(start + f), round(finish + f), r_out);
getarccoords(arc_coords);
with arc_coords do begin
line(xs_in, ys_in, xstart, ystart);
line(xf_in, yf_in, xend, yend);
end;
end;
begin
setfillstyle(solidfill, white);
circle(0, 0, r);
line(
trunc(r*cos(f*pi/180)), trunc(-r*sin(f*pi/180)),
trunc(r*cos((180+f)*pi/180)), trunc(-r*sin((180+f)*pi/180))
);
floodfill(
trunc((r/2)*cos((trunc(f+270) mod 360)*pi/180)),
trunc(-(r/2)*sin((trunc(f+270) mod 360)*pi/180)),
white
);
dec(r, 16);
put_arc(135, 180, r);
put_arc(90, 135, r);
put_arc(45, 90, r);
put_arc(0, 45, r);
end;
var
gd, gm: integer;
i: integer;
begin
initgraph(gd, gm, '');
setviewport(getmaxx div 2, getmaxy div 2, getmaxx, getmaxy, false);
for i := 0 to 120 do begin
cleardevice;
disk(i, 50);
delay(1575);
end;
readln;
closegraph;
end.