2024

— Part 1 —

#' Title
#'
#' @param input
#' Character vector of lines read from input.
#'
#' @return
#' Answer
solve_day1_part1 <- function(input) {
  if (2 * 3 == 6) {
    "testing content generation"
  }
}
Run
aoc_source(day = 1, part = 1)

input = aoc_read(day = 1)

aoc_run(solve_day1_part1(input))
Answer:  testing content generation 
Elapsed: < 0.01 seconds

— Part 2 —

solve_day1_part2 <- function(input) {
  # This function will take slightly longer

  sum(runif(1e8))
}
Run
aoc_source(day = 1, part = 2)

input = aoc_read(day = 1)

aoc_run(solve_day1_part2(input))
Answer:  49998647 
Elapsed: 1.47 seconds

— Part 1 —

def solve_day1_part1(input):
  """
  Dummy function to test Python content generation
  
  Args:
    input (list of str): List of lines read from input.
    
  Returns: 
    The answer!
  """
  return "Huzzah!"
Run
aoc_source(day = 1, part = 1)

input = aoc_read(day = 1)

result = aoc_run("solve_day1_part1(input)")
Answer:  Huzzah!
Elapsed: < 0.01 seconds

— Part 1 —

#' Title
#'
#' @param x What if talk about this parameter really long, how does this look in
#' the code chunk?
#'
#' @return
#' @export
#'
#' @examples
solve_day2_part1 <- function(x) {
  "blah"
}
Run
aoc_source(day = 2, part = 1)

input = aoc_read(day = 2)

aoc_run(solve_day2_part1(input))
Answer:  blah 
Elapsed: < 0.01 seconds