Как сделать люстру и поместить в нее эту лампочку в паскале? uses crt,graphabc; procedure drawlamp(state: boolean); begin setfontsize(20); if state = true then begin setbrushcolor(clblack); setfontcolor(clwhite); textout(200,450,'true'); end else begin setbrushcolor(clwhite); setfontcolor(clblack); textout(200,450,'false'); end; end; procedure zokol; var i: byte; begin for i: =1 to 10 do begin if odd(i) then setbrushcolor(clbrown) else setbrushcolor(cldkgray); ellipse(199,300+(i*10),301,300+(i*10)+20); end; setbrushcolor(clblack); ellipse(230,410,270,430); end; procedure dark; begin clearwindow(clblack); zokol; setpencolor(clwhite); arc(250,150,100,-60,240); line(200,230,200,320); line(300,230,300,320); floodfill(250,250,clyellow); setbrushcolor(clwhite); circle(250,150,60); end; procedure ligth; begin clearwindow(clwhite); zokol; setpencolor(clblack); arc(250,150,100,-60,240); line(200,230,200,320); line(300,230,300,320); end; var lampstate: boolean; key: char; begin setwindowsize(500,500); hidecursor; lampstate : = false; repeat if lampstate=true then dark else ligth; drawlamp(lampstate); key : = readkey; if key = 'h' then lampstate : = not(lampstate); until key = #27; end.
const
cx = 200;
cy = 200;
radius = 150;
procedure Chandelier(PenColor, BrushColor: Color);
begin
SetPenColor(PenColor);
SetBrushColor(BrushColor);
Line(cx, 0, cx, cy - radius);
FillPie(cx, cy, radius, 0, 180);
Ellipse(cx - radius, cy - 30, cx + radius, cy + 30);
end;
procedure Dark();
begin
ClearWindow(clBlack);
Chandelier(clGreen, clDarkGreen);
SetBrushColor(clBlack);
SetFontColor(clWhite);
TextOut(cx - 30, 2 * cy - 50, 'False');
end;
procedure Light();
begin
ClearWindow(clSilver);
SetBrushColor(clLightGoldenrodYellow);
FillPie(cx, cy - radius div 2, 3 * cx, 210, 330);
Chandelier(clGreen, clLime);
SetBrushColor(clYellow);
FillCircle(cx, cy - radius div 2, 35);
SetBrushColor(clLightGoldenrodYellow);
SetFontColor(clBlack);
TextOut(cx - 30, 2 * cy - 50, 'True');
end;
procedure DrawLamp(state: Boolean);
begin
if state then
Light()
else Dark();
end;
var
LampState: Boolean;
key: Char;
begin
SetWindowSize(2 * cx, 2 * cy);
SetFontSize(20);
LampState := False;
repeat
DrawLamp(LampState);
key := ReadChar();
if key = 'h' then
LampState := not LampState;
until key = #27;
end.