Skip to content

Commit 114507d

Browse files
committed
Established Template for R, fixed some assignments in 2015
1 parent 36ef49f commit 114507d

File tree

10 files changed

+1124
-10
lines changed

10 files changed

+1124
-10
lines changed

2015/README.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
# 🎄 Advent of Code 2020 🎁
1+
# 🎄 Advent of Code 2015 🎁
22

33
| Assignment | Data | Solution R | Solution Python | Solution C++ | Part 1 | Part 2 |
44
|-------|---|---|---|---|:-:|:-:|
5-
| [Day 1: Report Repair](https://adventofcode.com/2020/day/1) | [Data](data/day1.txt) | [R - D1](solutionsR/day1.R) | | |||
6-
| [Day 2: Password Philosophy](https://adventofcode.com/2020/day/2) | [Data](data/day2.txt) | [R - D2](solutionsR/day2.R) | | |||
5+
| [Day 1: Not Quite Lisp](https://adventofcode.com/2015/day/1) | [Data](data/day01.txt) | [R - D1](solutionsR/day01.R) | | |||
6+
| [Day 2: I Was Told There Would Be No Math](https://adventofcode.com/2015/day/2) | [Data](data/day02.txt) | [R - D2](solutionsR/day02.R) | | |||
77
| [Day 3: Toboggan Trajectory](https://adventofcode.com/2020/day/3) | [Data](data/day3.txt) | [R - D3](solutionsR/day3.R) | | |||
88
| [Day 4: Passport Processing](https://adventofcode.com/2020/day/4) | [Data](data/day4.txt) | [R - D4](solutionsR/day4.R) | | |||
99
| [Day 5: Binary Boarding](https://adventofcode.com/2020/day/5) | [Data](data/day5.txt) | [R - D5](solutionsR/day5.R) | | |||
@@ -32,4 +32,4 @@
3232
### Notes
3333
Every day's assignment links to the AOC website. However, just in case, the assignments are backed up in the *assignments* folder. The input data generated by the website is not the same for everyone. The inputs generated for me are stored in the *data* folder.
3434

35-
![https://adventofcode.com/2020](aoc2020.png)
35+
![https://adventofcode.com/2015](aoc2015.png)

2015/assignments/day01.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*--- Day 1: Not Quite Lisp ---*
1+
**--- Day 1: Not Quite Lisp ---**
22

33
Santa was hoping for a white Christmas, but his weather machine's "snow" function is powered by stars, and he's fresh out! To save Christmas, he needs you to collect fifty stars by December 25th.
44

@@ -20,9 +20,9 @@ For example:
2020
()) and ))( both result in floor -1 (the first basement level).
2121
))) and )())()) both result in floor -3.
2222

23-
**To what floor do the instructions take Santa?**
23+
*To what floor do the instructions take Santa?*
2424

25-
*--- Part Two ---*
25+
**--- Part Two ---**
2626

2727
Now, given the same instructions, find the position of the first character that causes him to enter the basement (floor -1). The first character in the instructions has position 1, the second character has position 2, and so on.
2828

@@ -31,4 +31,4 @@ For example:
3131
* ) causes him to enter the basement at character position 1.
3232
* ()()) causes him to enter the basement at character position 5.
3333

34-
**What is the position of the character that causes Santa to first enter the basement?**
34+
*What is the position of the character that causes Santa to first enter the basement?*

2015/assignments/day02.md

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
**--- Day 2: I Was Told There Would Be No Math ---**
2+
3+
The elves are running low on wrapping paper, and so they need to submit an order for more. They have a list of the dimensions (length l, width w, and height h) of each present, and only want to order exactly as much as they need.
4+
5+
Fortunately, every present is a box (a perfect right rectangular prism), which makes calculating the required wrapping paper for each gift a little easier: find the surface area of the box, which is 2*l*w + 2*w*h + 2*h*l. The elves also need a little extra paper for each present: the area of the smallest side.
6+
7+
For example:
8+
9+
* A present with dimensions 2x3x4 requires 2x6 + 2x12 + 2x8 = 52 square feet of wrapping paper plus 6 square feet of slack, for a total of 58 square feet.
10+
* A present with dimensions 1x1x10 requires 2x1 + 2x10 + 2x10 = 42 square feet of wrapping paper plus 1 square foot of slack, for a total of 43 square feet.
11+
12+
*All numbers in the elves' list are in feet. How many total square feet of wrapping paper should they order?*
13+
14+
**--- Part Two ---**
15+
16+
The elves are also running low on ribbon. Ribbon is all the same width, so they only have to worry about the length they need to order, which they would again like to be exact.
17+
18+
The ribbon required to wrap a present is the shortest distance around its sides, or the smallest perimeter of any one face. Each present also requires a bow made out of ribbon as well; the feet of ribbon required for the perfect bow is equal to the cubic feet of volume of the present. Don't ask how they tie the bow, though; they'll never tell.
19+
20+
For example:
21+
22+
* A present with dimensions 2x3x4 requires 2+2+3+3 = 10 feet of ribbon to wrap the present plus 2*3*4 = 24 feet of ribbon for the bow, for a total of 34 feet.
23+
* A present with dimensions 1x1x10 requires 1+1+1+1 = 4 feet of ribbon to wrap the present plus 1*1*10 = 10 feet of ribbon for the bow, for a total of 14 feet.
24+
25+
*How many total feet of ribbon should they order?*

0 commit comments

Comments
 (0)