Exemplo n.º 1
0
 private static void move1(Column from, Column to)
 {
     to.rings[to.height] = from.rings[from.height - 1];
     to.height           = to.height + 1;
     from.height         = from.height - 1;
     to.Validate();
     from.Validate();
 }
Exemplo n.º 2
0
 private static void move1(Column from, Column to)
 {
     to.rings[to.height] = from.rings[from.height - 1];
     to.height = to.height + 1;
     from.height = from.height - 1;
     to.Validate();
     from.Validate();
 }
Exemplo n.º 3
0
 private static int Main()
 {
     Column c1 = new Column(17, 17);
     Column c2 = new Column(17, 0);
     Column c3 = new Column(17, 0);
     int ec = move(ref c1, ref c2, ref c3, 17) - 130971;
     c1.Validate();
     c2.Validate();
     c3.Validate();
     return ec;
 }
Exemplo n.º 4
0
        public static int TestEntryPoint()
        {
            Column c1 = new Column(17, 17);
            Column c2 = new Column(17, 0);
            Column c3 = new Column(17, 0);
            int    ec = move(ref c1, ref c2, ref c3, 17) - 130971;

            c1.Validate();
            c2.Validate();
            c3.Validate();
            return(ec);
        }
Exemplo n.º 5
0
        private static int Main()
        {
            Column c1 = new Column(17, 17);
            Column c2 = new Column(17, 0);
            Column c3 = new Column(17, 0);
            int    ec = move(ref c1, ref c2, ref c3, 17) - 130971;

            c1.Validate();
            c2.Validate();
            c3.Validate();
            return(ec);
        }
Exemplo n.º 6
0
 private static int move(ref Column from, ref Column to, ref Column temp, int num)
 {
     to.Validate();
     from.Validate();
     temp.Validate();
     int C = 1;
     if (num == 1)
     {
         move1(ref from, ref to);
     }
     else
     {
         C += move(ref from, ref temp, ref to, num - 1);
         move1(ref from, ref to);
         C += move(ref temp, ref to, ref from, num - 1);
     }
     return C;
 }
Exemplo n.º 7
0
 private static int move(Column from, Column to, Column temp, int num)
 {
     to.Validate();
     from.Validate();
     temp.Validate();
     int C = 1;
     if (num == 1)
     {
         move1(from, to);
     }
     else
     {
         C += move(from, temp, to, num - 1);
         move1(from, to);
         C += move(temp, to, from, num - 1);
     }
     return C;
 }
Exemplo n.º 8
0
        private static int move(ref Column from, ref Column to, ref Column temp, int num)
        {
            to.Validate();
            from.Validate();
            temp.Validate();
            int C = 1;

            if (num == 1)
            {
                move1(ref from, ref to);
            }
            else
            {
                C += move(ref from, ref temp, ref to, num - 1);
                move1(ref from, ref to);
                C += move(ref temp, ref to, ref from, num - 1);
            }
            return(C);
        }
Exemplo n.º 9
0
        private static int move(Column from, Column to, Column temp, int num)
        {
            to.Validate();
            from.Validate();
            temp.Validate();
            int C = 1;

            if (num == 1)
            {
                move1(from, to);
            }
            else
            {
                C += move(from, temp, to, num - 1);
                move1(from, to);
                C += move(temp, to, from, num - 1);
            }
            return(C);
        }