示例#1
0
        public void BreadthFirstSearchTest_PerimeterOnly_2()
        {
            string initialMap = @"
...xxxx
..xaaax
.xaaaax
xaaxaax
xaaaax.
xaaax..
xxxx...
";

            expectedMap = @"
...####
..#...#
.#....#
#..#..#
#....#.
#...#..
####...
";

            map = MapTestHelper.FromMapString(initialMap);

            matchingCells = BreadthFirstSearch.Search(
                map.Single(cell => cell.Coord == new Coord(1, 4)),
                cell => cell.Colour == 0,
                true);

            assertMatchingCells();
        }
示例#2
0
        public void BreadthFirstSearchTest_WholeArea()
        {
            string initialMap = @"
...xxxx
..aaaxx
.xxxaxx
xxaaaxx
xaaxxx.
aaaxx..
aaxx...
";

            expectedMap = @"
.......
..###..
....#..
..###..
.##....
###....
##.....
";

            map = MapTestHelper.FromMapString(initialMap);

            matchingCells = BreadthFirstSearch.Search(
                map.Single(cell => cell.Coord == new Coord(6, 0)),
                cell => cell.Colour == 0,
                false);

            assertMatchingCells();
        }