test_that("Day 20", {
input <- '..#.#..#####.#.#.#.###.##.....###.##.#..###.####..#####..#....#..#..##..###..######.###...####..#..#####..##..#.#####...##.#.#..#.##..#.#......#.###.######.###.####...#.##.##..#..#..#####.....#.#....###..#.##......#.....#..#..#..##..#...##.######.####.####.#.#...#.......#..#.#.#...####.##.#......#..#...##.#.##..#...##.#.##..###.#......#.#.......#.#.#.####.###.##...#.....####.#..#..#.##.#....##..#.####....##...##..#...#......#.#.......#.......##..####..#...#.#.#...##..#.#..###..#####........#..####......#..#
#..#.
#....
##..#
..#..
..###'
example <- read_pixels(textConnection(input))
expect_length(example$algorithm, 512)
enhanced <- enhance_image(example$image, example$algorithm, 2)
expect_equal(sum(enhanced), 35)
enhanced50 <- enhance_image(example$image, example$algorithm, 50)
expect_equal(sum(enhanced50), 3351)
})
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.