MoveRow() public method

public MoveRow ( int nrow, int value ) : void
nrow int
value int
return void
Exemplo n.º 1
0
        public void GetMinUnsolvedWithRowMove()
        {
            Pattern pattern = new Pattern(2, 2);

            pattern.SetRow(0, "1 2");
            pattern.SetRow(1, "4 3");

            pattern.MoveRow(0, 1);

            var result = pattern.GetMinUnsolved();

            Assert.IsNotNull(result);
            Assert.AreEqual(0, result.Row);
            Assert.AreEqual(1, result.Column);
            Assert.AreEqual(2, result.Value);
        }
Exemplo n.º 2
0
        public void ValidRowMoveAfterMove()
        {
            Pattern pattern = new Pattern(2, 2);

            pattern.SetRow(0, "1 2");
            pattern.SetRow(1, "2 3");

            pattern.MoveRow(1, 3);

            Assert.IsTrue(pattern.IsValidRowMove(0, 2));
            Assert.IsFalse(pattern.IsValidRowMove(0, 1));
            Assert.IsFalse(pattern.IsValidRowMove(0, 0));

            Assert.IsFalse(pattern.IsValidRowMove(1, 3));
            Assert.IsFalse(pattern.IsValidRowMove(1, 2));
            Assert.IsFalse(pattern.IsValidRowMove(1, 1));
        }