inst/run-day05.R

library(adventofcode21)
x <- readLines("./inst/input05.txt") %>%
  strsplit("\\D+") %>%
  lapply(as.numeric)
x <- do.call(rbind.data.frame, x)
names(x) <- c("x1", "y1", "x2", "y2")

p1 <- f05a(x)
p2 <- f05b(x)

stopifnot(p1 == aoc_solutions$day05a)
stopifnot(p2 == aoc_solutions$day05b)

readRDS(
Bisaloo/adventofcode21 documentation built on Dec. 17, 2021, 11:48 a.m.