示例#1
0
        public void IsComplete_1_Test()
        {
            var RowRules = new List<List<int>> {
                new List<int>{1},
                new List<int>{2},
                new List<int>{1}
            };
            var ColumnRules = new List<List<int>> {
                new List<int>{1},
                new List<int>{1},
                new List<int>{2}
            };
            var model = new NonogramModel(3, 3, RowRules, ColumnRules);

            model[2, 0].State = BoardItemState.Marked;
            model[1, 1].State = BoardItemState.Marked;
            model[2, 1].State = BoardItemState.Marked;
            model[0, 2].State = BoardItemState.Marked;

            Assert.IsTrue(model.IsComplete());
        }
示例#2
0
        public void IsComplete_2_Test()
        {
            var RowRules = new List<List<int>> {
                new List<int>{4},
                new List<int>{4},
                new List<int>{4},
                new List<int>{5},
                new List<int>{1}
            };
            var ColumnRules = new List<List<int>> {
                new List<int>{4},
                new List<int>{4},
                new List<int>{4},
                new List<int>{4},
                new List<int>{2}
            };
            var model = new NonogramModel(5, 5, RowRules, ColumnRules);

            model[0, 0].State = BoardItemState.Marked;
            model[0, 1].State = BoardItemState.Marked;
            model[0, 2].State = BoardItemState.Marked;
            model[0, 3].State = BoardItemState.Marked;

            model[1, 0].State = BoardItemState.Marked;
            model[1, 1].State = BoardItemState.Marked;
            model[1, 2].State = BoardItemState.Marked;
            model[1, 3].State = BoardItemState.Marked;

            model[2, 0].State = BoardItemState.Marked;
            model[2, 1].State = BoardItemState.Marked;
            model[2, 2].State = BoardItemState.Marked;
            model[2, 3].State = BoardItemState.Marked;

            model[3, 0].State = BoardItemState.Marked;
            model[3, 1].State = BoardItemState.Marked;
            model[3, 2].State = BoardItemState.Marked;
            model[3, 3].State = BoardItemState.Marked;

            model[4, 3].State = BoardItemState.Marked;
            model[4, 4].State = BoardItemState.Marked;

            Assert.IsTrue(model.IsComplete());
        }