Ejemplo n.º 1
0
        public void Sample()
        {
            OneLookLLCube cube = new OneLookLLCube();

            cube.Solve();
            cube.SetUpPosition(3776);
            int posNum = cube.GetPosNum();

            Assert.AreEqual(3776, posNum, "failed no auf");
            cube.Solve();
            cube.SetUpPosition(3776);
            cube.U();
            posNum = cube.GetPosNum();
            Assert.AreEqual(3776, posNum, "failed U");
            cube.Solve();
            cube.SetUpPosition(3776);
            cube.U2();
            posNum = cube.GetPosNum();
            Assert.AreEqual(3776, posNum, "failed U2");
            cube.Solve();
            cube.SetUpPosition(3776);
            cube.Ui();
            posNum = cube.GetPosNum();
            Assert.AreEqual(3776, posNum, "failed U'");
        }
Ejemplo n.º 2
0
        public void DifferentAngle()
        {
            OneLookLLCube cube = new OneLookLLCube();

            cube.Solve();
            cube.SetUpPosition(447);
            cube.U2();
            int num = cube.GetPosNum();

            Assert.AreEqual(447, num);
        }
Ejemplo n.º 3
0
        public void PllTests()
        {
            OneLookLLCube cube = new OneLookLLCube();

            for (int k = 0; k < 72; k++)
            {
                cube.Solve();
                cube.SetUpPll(k);
                int pllNum = cube.GetPllNum();
                Assert.AreEqual(k, pllNum, "failed on position " + k);
            }
        }
Ejemplo n.º 4
0
        public void HCaseTests()
        {
            OneLookLLCube cube = new OneLookLLCube();

            for (int k = 3552; k < 3776; k++)
            {
                cube.Solve();
                cube.SetUpPosition(k);
                //cube.RandomUMove();
                int posNum = cube.GetPosNum();
                Assert.AreEqual(k, posNum, "failed on position " + k);
            }
        }
Ejemplo n.º 5
0
        public void DotTests()
        {
            OneLookLLCube cube = new OneLookLLCube();

            for (int k = 480; k < 960; k++)
            {
                cube.Solve();
                cube.SetUpPosition(k);
                cube.Ui();
                int posNum = cube.GetPosNum();
                Assert.AreEqual(k, posNum, "failed on position " + k);
            }
        }
Ejemplo n.º 6
0
        /// <summary>
        /// Sends an ELLCP position number back to the client
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void SetUpEllcpButton_Click(object sender, EventArgs e)
        {
            if (!Cube.IsEllcp())
            {
                MessageBox.Show("Not a valid ELLCP position", "error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }
            var cube   = new OneLookLLCube(Cube.Stickers);
            int posNum = cube.GetPosNum();

            _callback(AlgSet.ELLCP, posNum - 3776);
            this.Close();
        }
Ejemplo n.º 7
0
        /// <summary>
        /// Sends a 1LLL position number back to the client
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void SetUp1lllButton_Click(object sender, EventArgs e)
        {
            if (!Cube.Is1lll())
            {
                MessageBox.Show("PLL not allowed", "error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }
            var cube   = new OneLookLLCube(Cube.Stickers);
            int posNum = cube.GetPosNum();

            _callback(AlgSet.OneLookLL, posNum);
            this.Close();
        }
Ejemplo n.º 8
0
        public void OrientTests()
        {
            OneLookLLCube cube = new OneLookLLCube();

            for (int k = 0; k < 30; k++)
            {
                cube.Solve();
                cube.SetUpPosition(72 * k + 960);
                cube.AufToDefault();
                cube.Orient();
                int num = cube.GetPllNum();
                Assert.AreEqual(0, num, "failed on position " + 72 * k + 960);
            }
        }
Ejemplo n.º 9
0
        public void EdgeOrientationTests()
        {
            OneLookLLCube cube = new OneLookLLCube();

            for (int k = 0; k < 36; k++)
            {
                int posNum = 72 * k + 960;
                cube.Solve();
                cube.SetUpPosition(posNum);
                cube.RandomUMove();
                cube.AufToDefault();
                int num = cube.GetEdgeOrientationNum();
                Assert.AreEqual(k % 6, num, "failed on position " + k);
            }
        }
Ejemplo n.º 10
0
        public void OneLookTests()
        {
            OneLookLLCube cube = new OneLookLLCube();

            for (int k = 0; k < cube.GetNumPositions(); k++)
            {
                cube.Solve();
                cube.SetUpPosition(k);
                if (!((k >= 460 && k < 480) || (k >= 940 && k < 980)))
                {
                    cube.RandomUMove();
                }
                int posNum = cube.GetPosNum();
                Assert.AreEqual(k, posNum, "failed on position " + k);
            }
        }
Ejemplo n.º 11
0
        public void CornerOrientationTests()
        {
            int           num;
            OneLookLLCube cube = new OneLookLLCube();

            for (int k = 0; k < 480; k += 24)
            {
                cube.Solve();
                cube.SetUpPosition(k);
                cube.RandomUMove();
                num = cube.GetCornerOrientationNum();
                Assert.AreEqual(k / 72, num, "failed on position " + k);
            }
            cube.Solve();
            cube.HOrientation();
            num = cube.GetCornerOrientationNum();
            Assert.AreEqual(6, num, "failed on h orientation");
            cube.U();
            num = cube.GetCornerOrientationNum();
            Assert.AreEqual(6, num, "failed on h orientation");
            cube.Solve();
            num = cube.GetCornerOrientationNum();
            Assert.AreEqual(7, num, "failed with corners oriented");
        }
Ejemplo n.º 12
0
        /// <summary>
        /// paints this cube
        /// </summary>
        /// <param name="e"></param>
        /// <param name="sizeRatio">the rrelative size of the cube</param>
        public void Paint(PaintEventArgs e, double sizeRatio)
        {
            var cube = new OneLookLLCube(Stickers);

            cube.Paint2D(e.Graphics, sizeRatio, 0, 0, 18);
        }