Esempio n. 1
0
            public void extend(int o, Nod ch)
            {
                if (o >= 50)
                {
                    return;
                }

                int _offsetX = 5;

                int offsetX = _offsetX;
                int offsetY = 15;

                //left
                if (ch.x > me.bmp.Width / 2)
                {
                    offsetX = 0;
                }
                else
                {
                    offsetX = _offsetX;
                }
                Nod cl = new Nod(ch.x - offsetX, ch.y + offsetY, ch.nr * 2, ch.p + 1, new Point(ch.x, ch.y));

                //me.draw(cl);

                ch.extend(o + 1, cl);

                //right
                if (ch.x < me.bmp.Width / 2)
                {
                    offsetX = 0;
                }
                else
                {
                    offsetX = _offsetX;
                }
                Nod cr = new Nod(ch.x + offsetX, ch.y + offsetY, (ch.nr - 1) / 3, ch.p + 1, new Point(ch.x, ch.y));

                //me.draw(cr);
                if (ch.nr % 3 != 0)
                {
                    ch.extend(o + 1, cr);
                }
            }
Esempio n. 2
0
        private void pictureBox1_Click(object sender, EventArgs e)
        {
            if (!wasStarted)
            {
                Start();
                wasStarted = true;
            }
            //for(int i=0;i<1;i++)
            //    Step();

            draw(radacina);
            radacina.extend(0, radacina);
        }