knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "man/figures/README-",
  out.width = "100%"
)

AoC2017

R-CMD-check

AoC2017 is an R package that is intended to solve problems from Advent of Code 2017. Some of the solutions run relatively slowly and perhaps could be implemented better. In some cases, I've used C++ to speed up the computations where I felt further optimisation was not possible in R directly...

Installation

You can install the released version of AoC2017 from GitHub with:

devtools::install_github("danhalligan/AoC2017")

Example

To solve a specific day, you can use solve_day, passing in the input for the current day.

library(AoC2017)
solve_day(day = 1, file = "day1-input.txt")
solve_day(file = "day1-input.txt")

If day is not provided it is guessed from the filename.

solve_day(file = "day1-input.txt")

Alternatively, some questions only require a short integer to be provided as input:

library(AoC2017)
solve_day(day = 3, input = 1024)


danhalligan/AoC2017 documentation built on Oct. 2, 2022, 10:30 a.m.