uses graphABC;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.