Написание программы моделирования работы елочной гирлянды, страница 3

              Form1->Lamp6->Brush->Color = clWhite;

              Sleep(100);

              Form1->Lamp7->Brush->Color = clWhite;

              Sleep(100);

              Form1->Lamp8->Brush->Color = clWhite;

              Sleep(100);

              Form1->Lamp9->Brush->Color = clWhite;

              Sleep(100);

              Form1->Lamp17->Brush->Color = clWhite;

              Sleep(100);

              Form1->Lamp18->Brush->Color = clWhite;

              Sleep(100);

              Form1->Lamp19->Brush->Color = clWhite;

              Sleep(100);

              Form1->Lamp20->Brush->Color = clWhite;

              Sleep(100);

              Form1->Lamp21->Brush->Color = clWhite;

              Sleep(100);

              Form1->Lamp22->Brush->Color = clWhite;

              Sleep(100);

              Form1->Lamp23->Brush->Color = clWhite;

              Sleep(100);

             }  break;

             case 1:

             {

               Form1->Lamp4->Brush->Color = clRed;

               Form1->Lamp5->Brush->Color = clAqua;

               Form1->Lamp6->Brush->Color = clLime;

               Form1->Lamp7->Brush->Color = clRed;

               Form1->Lamp8->Brush->Color = clAqua;

               Form1->Lamp9->Brush->Color = clLime;

               Form1->Lamp17->Brush->Color = clRed;

               Form1->Lamp18->Brush->Color = clAqua;

               Form1->Lamp19->Brush->Color = clLime;

               Form1->Lamp20->Brush->Color = clRed;

               Form1->Lamp21->Brush->Color = clRed;

               Form1->Lamp23->Brush->Color = clNavy;

               Sleep(250);

               switch(param2) //Отключаем определённую лампочку гирлянды

               {

                     case 0: Form1->Lamp4->Brush->Color = clWhite;

                     case 1: Form1->Lamp5->Brush->Color = clWhite;

                     case 2: Form1->Lamp6->Brush->Color = clWhite;

                     case 3: Form1->Lamp7->Brush->Color = clWhite;

                     case 4: Form1->Lamp8->Brush->Color = clWhite;

                     case 5: Form1->Lamp9->Brush->Color = clWhite;

                     case 6: Form1->Lamp17->Brush->Color = clWhite;

                     case 7: Form1->Lamp18->Brush->Color = clWhite;

                     case 8: Form1->Lamp19->Brush->Color = clWhite;

                     case 9: Form1->Lamp20->Brush->Color = clWhite;

                     case 10: Form1->Lamp21->Brush->Color = clWhite;

                     case 11: Form1->Lamp23->Brush->Color = clWhite;

               };

               Sleep(500);

               param2++;

               if(param2 == 11) param2 = 0;

             }

             break;

             case 2:

             {

               Form1->Lamp4->Brush->Color = clRed;

               Form1->Lamp5->Brush->Color = clWhite;

               Form1->Lamp6->Brush->Color = clLime;

              Form1->Lamp7->Brush->Color = clNavy;

              Form1->Lamp8->Brush->Color = clWhite;

              Form1->Lamp9->Brush->Color = clLime;

              Form1->Lamp17->Brush->Color = clRed;

              Form1->Lamp18->Brush->Color = clWhite;

              Form1->Lamp19->Brush->Color = clLime;

              Form1->Lamp20->Brush->Color = clRed;

              Form1->Lamp21->Brush->Color = clWhite;

              Form1->Lamp22->Brush->Color = clNavy;

              Form1->Lamp23->Brush->Color = clLime;

               Sleep(200);

              Form1->Lamp5->Brush->Color = clYellow;

              Form1->Lamp8->Brush->Color = clYellow;

              Form1->Lamp18->Brush->Color = clYellow;

              Form1->Lamp21->Brush->Color = clYellow;

               Sleep(650);

             }

             break;

        };

     }

  };

}

//---------------------------------------------------------------------------

void __fastcall TForm1::Button1Click(TObject *Sender)

{

     Close();

}

//---------------------------------------------------------------------------

void __fastcall TForm1::Button2Click(TObject *Sender)

{

   if(stop1 == false)

   {

      stop1 = true;

      Button2->Caption = "Включить";

          // "Отключаем 1-ю гирлянду"

              Form1->Lamp1->Brush->Color = clWhite;

              Form1->Lamp2->Brush->Color = clWhite;

              Form1->Lamp3->Brush->Color = clWhite;

              Form1->Lamp10->Brush->Color = clWhite;

              Form1->Lamp11->Brush->Color = clWhite;

              Form1->Lamp12->Brush->Color = clWhite;

              Form1->Lamp13->Brush->Color = clWhite;