Exemplo n.º 1
0
        public void Rotate_B1F()
        {
            var expectedCube = new Cube2(
                "  31  " +
                "  31  " +
                "225344" +
                "225344" +
                "  65  " +
                "  65  " +
                "  16  " +
                "  16  ");

            var cube = new Cube2();

            cube.Rotate("b1");

            Assert.AreEqual(expectedCube, cube);

            Assert.AreEqual(
                "21" + Environment.NewLine +
                "43" + Environment.NewLine +
                "65" + Environment.NewLine +
                "07" + Environment.NewLine,
                cube.ToStringPieces());
        }
Exemplo n.º 2
0
        public void SequenceOfRotationLeadsToSolvedCube()
        {
            var cube = new Cube2();

            for (int i = 0; i < 15; i++)
            {
                cube.Rotate("a1");
                cube.Rotate("c1");
            }
            Assert.AreEqual(cube, new Cube2());
        }
Exemplo n.º 3
0
 // Use this for initialization
 void Start()
 {
     realz       = transform.position.z;
     initialz    = realz;
     initialx    = transform.position.x;
     initialy    = transform.position.y;
     Random.seed = 22;
     System.Random rn = new System.Random();
     k         = rn.Next(2, 20);
     movespeed = 6;
     cube2     = GameObject.Find("Cube2").GetComponent <Cube2>();
     flag      = false;
 }
Exemplo n.º 4
0
        public void Rotate_A1F()
        {
            var expectedCube = new Cube2(
                "  11  " +
                "  22  " +
                "253314" +
                "253314" +
                "  44  " +
                "  55  " +
                "  66  " +
                "  66  ");

            var cube = new Cube2();

            cube.Rotate("a1");

            Assert.AreEqual(expectedCube, cube);
        }
Exemplo n.º 5
0
        public void Rotate_A1F_B1F()
        {
            var expectedCube = new Cube2(
                "  31  " +
                "  32  " +
                "554314" +
                "225314" +
                "  64  " +
                "  65  " +
                "  16  " +
                "  26  ");

            var cube = new Cube2();

            cube.Rotate("a1");
            cube.Rotate("b1");

            Assert.AreEqual(expectedCube, cube);
        }
Exemplo n.º 6
0
 // Use this for initialization
 void Start()
 {
     cube = new Cube2();
     StartCoroutine(cube.Scramble(1000));
 }