danhalligan / AoC2017

πŸŽ„ Advent of Code 2017 solutions as an R package

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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)
#> Part 1: 31 
#> Part 2: 1968

About

πŸŽ„ Advent of Code 2017 solutions as an R package

License:Other


Languages

Language:R 92.0%Language:C++ 8.0%