file <- create_test_file("..#.#..#####.#.#.#.###.##.....###.##.#..###.####..#####..#....#..#..##..###..######.###...####..#..#####..##..#.#####...##.#.#..#.##..#.#......#.###.######.###.####...#.##.##..#..#..#####.....#.#....###..#.##......#.....#..#..#..##..#...##.######.####.####.#.#...#.......#..#.#.#...####.##.#......#..#...##.#.##..#...##.#.##..###.#......#.#.......#.#.#.####.###.##...#.....####.#..#..#.##.#....##..#.####....##...##..#...#......#.#.......#.......##..####..#...#.#.#...##..#.#..###..#####........#..####......#..#
#..#.
#....
##..#
..#..
..###")
input <- read_trench_map(file)
test_that(test_name(day = 20, part = 1), {
expect_true(sum(enhance_image_iter(input, steps = 2) == "#") == 35)
expect_true(sum(enhance_image_mapply(input, steps = 2) == "#") == 35)
})
test_that(test_name(day = 20, part = 2), {
expect_true(sum(enhance_image_iter(input, steps = 50) == "#") == 3351)
expect_true(sum(enhance_image_mapply(input, steps = 50) == "#") == 3351)
})
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.