Exemple #1
0
        public override void Resolve(RubikCube from, RubikCube to) // From: Generalmente mastercube To: Obtener un cubo que contemple el modelo recibido
        {
            this.init();

            RubikCube WorkingCube = from.Clone();

            if (!to.Equals(from))
            {
                this.startProcess(() => _resolve(from, to));
            }
            else
            {
                this.cubeMatch = from.Clone();
            }
        }
Exemple #2
0
        private void _resolve(RubikCube from, RubikCube to)
        {
            RubikCube working  = from.Clone();
            RubikCube template = new RubikCube();

            template.clear();
            template.ToMatrix()[2, 4, 2] = to.ToMatrix()[2, 4, 2];
            template.ToMatrix()[2, 4, 3] = to.ToMatrix()[2, 4, 3];
            template.ToMatrix()[2, 3, 4] = to.ToMatrix()[2, 3, 4];

            working = this._resolveCross(working, template.Clone());
            if (working != null)
            {
                template.ToMatrix()[1, 4, 2] = to.ToMatrix()[1, 4, 2];
                template.ToMatrix()[0, 3, 2] = to.ToMatrix()[0, 3, 2];

                working = this._resolveCross(working, template.Clone());
                if (working != null)
                {
                    template.ToMatrix()[2, 4, 1] = to.ToMatrix()[2, 4, 1];
                    template.ToMatrix()[2, 3, 0] = to.ToMatrix()[2, 3, 0];

                    working = this._resolveCross(working, template.Clone());
                    if (working != null)
                    {
                        template.ToMatrix()[3, 4, 2] = to.ToMatrix()[3, 4, 2];
                        template.ToMatrix()[4, 3, 2] = to.ToMatrix()[4, 3, 2];

                        working = this._resolveCross(working, template.Clone());
                        if (working != null)
                        {
                            template.ToMatrix()[2, 2, 4] = to.ToMatrix()[2, 2, 4];
                            working = this._resolveCross(working, template.Clone());

                            if (working != null)
                            {
                                template.ToMatrix()[0, 2, 2] = to.ToMatrix()[0, 2, 2];
                                working = this._resolveCross(working, template.Clone());

                                if (working != null)
                                {
                                    template.ToMatrix()[2, 2, 0] = to.ToMatrix()[2, 2, 0];
                                    working = this._resolveCross(working, template.Clone());
                                    if (working != null)
                                    {
                                        template.ToMatrix()[4, 2, 2] = to.ToMatrix()[4, 2, 2];
                                        working = this._resolveCross(working, template.Clone());
                                    }
                                }
                            }
                        }
                    }
                }
            }
            this.cubeMatch = working;
        }
Exemple #3
0
        public ProcessParms(RubikCube workingCube, int deep, int currentAxis, ArrayList Moves)
        {
            this.Thread      = -1;
            this.WorkingCube = workingCube.Clone();
            this.Deep        = deep;
            this.CurrentAxis = currentAxis;
            this.Operations  = 0;
            this.Moves       = (ArrayList)Moves.Clone();

            // Console.WriteLine("Thread: {0} Axis: {1}", this.Thread.ToString(), this.CurrentAxis.ToString());
        }
        public override void Resolve(RubikCube from, RubikCube to) // From: Generalmente mastercube To: Obtener un cubo que contemple el modelo recibido
        {
            this.init(to);

            if (!to.Equals(from))
            {
                ProcessParms parms = null;

                // Load all axis
                parms = new ProcessParms(from, 0, 9, new ArrayList());
                fillCubeAux(parms);
            }
            else
            {
                this.cubeMatch = from.Clone();
            }
        }