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...
You can install the released version of AoC2017 from GitHub with:
devtools::install_github("danhalligan/AoC2017")
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)
#> Part 1: 31
#> Part 2: 1968
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.