Exemplo n.º 1
0
        private void Form1_Load(object sender, EventArgs e)
        {
            gr    = new Graphics[3];
            gr[0] = panel2.CreateGraphics();
            gr[1] = panel3.CreateGraphics();
            gr[2] = panel4.CreateGraphics();
            Pan   = new List <Panel>();
            Pan.Add(panel2);

            Pan.Add(panel3);
            Pan.Add(panel4);

            for (int i = 3; i < 10; i++)
            {
                comboBox1.Items.Add(i);
            }
            for (int i = 1; i < 4; i++)
            {
                comboBox2.Items.Add(i);
                comboBox3.Items.Add(i);
            }
            D = new Piramida[3];
            for (int i = 0; i < 3; i++)
            {
                D[i] = new Piramida(i);
            }
        }
Exemplo n.º 2
0
        void Peremeshenie(Piramida p1, Piramida p2)
        {
            p2.AddWheel(p1.Wheelss());
            p1.DeleteWheel();

            for (int i = 0; i < D.Length; i++)
            {
                gr[i].FillRectangle(new SolidBrush(Color.White), 0, 0, Pan[i].Width, Pan[i].Height);
                D[i].DrawPiramida(gr[i], Pan[i].Width, Pan[i].Height, n);
            }
            Thread.Sleep(time);
        }