Beispiel #1
0
        public void Trim()
        {
            var original = @"
#...##.#..
..#.#..#.#
.###....#.
###.##.##.
.###.#####
.##.#....#
#...######
.....#..##
#.####...#
#.##...##.".Trim();

            var expected = @"
.#.#..#.
###....#
##.##.##
###.####
##.#....
...#####
....#..#
.####...".Trim();

            var data     = original.ChopToList().Select(row => row.ToCharArray()).ToArray();
            var tile     = new Day20.Tile(0, data);
            var trimmed  = Day20.Trim(tile);
            var asString = Day20.DataToString(trimmed.Data).Trim();

            asString.ShouldBe(expected);
        }
Beispiel #2
0
        public void TransformSo()
        {
            var original = @"
#....####.
#..#.##...
#.##..#...
######.#.#
.#...#.#.#
.#########
.###.#..#.
########.#
##...##.#.
..###.#.#.".Trim();

            var expected = @"
..#.###...
##.##....#
..#.###..#
###.#..###
.######.##
#.#.#.#...
#.###.###.
#.###.##..
.######...
.##...####".Trim();

            var input    = original.ChopToList().Select(row => row.ToCharArray()).ToArray();
            var asTile   = new Day20.Tile(0, input);
            var r1       = Day20.TransformSo(asTile, "..#.###...", Day20.GetTop);
            var asString = Day20.DataToString(r1.Data);

            asString.ShouldBe(expected);
        }