From 58f56e33c721a5c97a014216ad646fbd96e5fd4c Mon Sep 17 00:00:00 2001 From: FrederikBaerentsen Date: Thu, 28 Nov 2024 19:48:55 +0100 Subject: [PATCH] Updated 2015/01,02,03 --- 2015/01/part1.py | 17 - 2015/01/solution.py | 46 ++ 2015/02/2.md | 63 +++ 2015/02/solution.py | 52 +++ 2015/03/3.md | 60 +++ 2015/03/solution.py | 110 +++++ 2015/day1/input | 1 - 2015/day1/part1.py | 17 - 2015/day1/part2.py | 20 - 2015/day1/test | 1 - 2015/day2/input | 1000 ------------------------------------------- 2015/day2/part1.py | 21 - 2015/day2/part2.py | 24 -- 2015/day2/test | 2 - 2015/day3/input | 1 - 2015/day3/part1.py | 41 -- 2015/day3/part2.py | 56 --- 2015/day3/test1 | 1 - 2015/day3/test2 | 1 - 2015/day3/test3 | 1 - 20 files changed, 331 insertions(+), 1204 deletions(-) delete mode 100644 2015/01/part1.py create mode 100644 2015/01/solution.py create mode 100644 2015/02/2.md create mode 100644 2015/02/solution.py create mode 100644 2015/03/3.md create mode 100644 2015/03/solution.py delete mode 100644 2015/day1/input delete mode 100644 2015/day1/part1.py delete mode 100644 2015/day1/part2.py delete mode 100644 2015/day1/test delete mode 100644 2015/day2/input delete mode 100644 2015/day2/part1.py delete mode 100644 2015/day2/part2.py delete mode 100644 2015/day2/test delete mode 100644 2015/day3/input delete mode 100644 2015/day3/part1.py delete mode 100644 2015/day3/part2.py delete mode 100644 2015/day3/test1 delete mode 100644 2015/day3/test2 delete mode 100644 2015/day3/test3 diff --git a/2015/01/part1.py b/2015/01/part1.py deleted file mode 100644 index e5375aa..0000000 --- a/2015/01/part1.py +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/python3 - -import sys -from pprint import pprint - -input_f = sys.argv[1] - -result = 0 - -with open(input_f) as file: - for line in file: - for idx,i in enumerate(line): - if i == '(': - result += 1 - if i == ')': - result -= 1 -print(result) diff --git a/2015/01/solution.py b/2015/01/solution.py new file mode 100644 index 0000000..d4f3e10 --- /dev/null +++ b/2015/01/solution.py @@ -0,0 +1,46 @@ +#!/bin/python3 +import sys,re +from pprint import pprint +sys.path.insert(0, '../../') +from fred import list2int + +input_f = 'input' + +part = 2 +######################################### +# # +# Part 1 # +# # +######################################### + +result = 0 +if part == 1: + with open(input_f) as file: + for line in file: + for idx,i in enumerate(line): + if i == '(': + result += 1 + if i == ')': + result -= 1 + print(result) + + + +######################################### +# # +# Part 2 # +# # +######################################### + +result = 0 +if part == 2: + with open(input_f) as file: + for line in file: + for idx,i in enumerate(line): + if i == '(': + result += 1 + if i == ')': + result -= 1 + if result == -1: + print(idx+1) + break \ No newline at end of file diff --git a/2015/02/2.md b/2015/02/2.md new file mode 100644 index 0000000..9147e19 --- /dev/null +++ b/2015/02/2.md @@ -0,0 +1,63 @@ +## \-\-- Day 2: I Was Told There Would Be No Math \-\-- + +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. + +Fortunately, every present is a box (a perfect [right rectangular +prism](https://en.wikipedia.org/wiki/Cuboid#Rectangular_cuboid)), 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. + +For example: + +- A present with dimensions `2x3x4` requires `2*6 + 2*12 + 2*8 = 52` + square feet of wrapping paper plus `6` square feet of slack, for a + total of `58` square feet. +- A present with dimensions `1x1x10` requires `2*1 + 2*10 + 2*10 = 42` + square feet of wrapping paper plus `1` square foot of slack, for a + total of `43` square feet. + +All numbers in the elves\' list are in +feet. +How many total *square feet of wrapping paper* should they order? + +Your puzzle answer was `1588178`. + +## \-\-- Part Two \-\-- {#part2} + +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. + +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. + +For example: + +- 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. +- 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. + +How many total *feet of ribbon* should they order? + +Your puzzle answer was `3783758`. + +Both parts of this puzzle are complete! They provide two gold stars: +\*\* + +At this point, you should [return to your Advent calendar](/2015) and +try another puzzle. + +If you still want to see it, you can [get your puzzle +input](2/input). + diff --git a/2015/02/solution.py b/2015/02/solution.py new file mode 100644 index 0000000..3b45b87 --- /dev/null +++ b/2015/02/solution.py @@ -0,0 +1,52 @@ +#!/bin/python3 +import sys,re +from pprint import pprint +sys.path.insert(0, '../../') +from fred import list2int + +input_f = 'input' + +part = 2 +######################################### +# # +# Part 1 # +# # +######################################### + +result = 0 + +if part == 1: + with open(input_f) as file: + for line in file: + tmp = line.rstrip().split('x') + tmp = list(map(int,tmp)) + first = tmp[0] * tmp[1] + second = tmp[1] * tmp[2] + third = tmp[2] * tmp[0] + smallest = min(first,second,third) + result = result + (2*first) + (2*second) + (2*third) + smallest + print(result) + +######################################### +# # +# Part 2 # +# # +######################################### + +result = 0 + +if part == 2: + with open(input_f) as file: + for line in file: + tmp = line.rstrip().split('x') + tmp = list(map(int,tmp)) + first = tmp[0] * tmp[1] + second = tmp[1] * tmp[2] + third = tmp[2] * tmp[0] + #2*l*w + 2*w*h + 2*h*l + smallest = min(first,second,third) + tmp.sort() + rib = tmp[0]+tmp[0]+tmp[1]+tmp[1] + bow = tmp[0]*tmp[1]*tmp[2] + result = result + rib + bow + print(result) diff --git a/2015/03/3.md b/2015/03/3.md new file mode 100644 index 0000000..f21a04e --- /dev/null +++ b/2015/03/3.md @@ -0,0 +1,60 @@ +## \-\-- Day 3: Perfectly Spherical Houses in a Vacuum \-\-- + +Santa is delivering presents to an infinite two-dimensional grid of +houses. + +He begins by delivering a present to the house at his starting location, +and then an elf at the North Pole calls him via radio and tells him +where to move next. Moves are always exactly one house to the north +(`^`), south (`v`), east (`>`), or west (`<`). After each move, he +delivers another present to the house at his new location. + +However, the elf back at the north pole has had a little too much +eggnog, and so his directions are a little off, and Santa ends up +visiting some houses more than once. How many houses receive *at least +one present*? + +For example: + +- `>` delivers presents to `2` houses: one at the starting location, + and one to the east. +- `^>v<` delivers presents to `4` houses in a square, including twice + to the house at his starting/ending location. +- `^v^v^v^v^v` delivers a bunch of presents to some very lucky + children at only `2` houses. + +Your puzzle answer was `2081`. + +## \-\-- Part Two \-\-- {#part2} + +The next year, to speed up the process, Santa creates a robot version of +himself, *Robo-Santa*, to deliver presents with him. + +Santa and Robo-Santa start at the same location (delivering two presents +to the same starting house), then take turns moving based on +instructions from the elf, who is +eggnoggedly +reading from the same script as the previous year. + +This year, how many houses receive *at least one present*? + +For example: + +- `^v` delivers presents to `3` houses, because Santa goes north, and + then Robo-Santa goes south. +- `^>v<` now delivers presents to `3` houses, and Santa and Robo-Santa + end up back where they started. +- `^v^v^v^v^v` now delivers presents to `11` houses, with Santa going + one direction and Robo-Santa going the other. + +Your puzzle answer was `2341`. + +Both parts of this puzzle are complete! They provide two gold stars: +\*\* + +At this point, you should [return to your Advent calendar](/2015) and +try another puzzle. + +If you still want to see it, you can [get your puzzle +input](3/input). + diff --git a/2015/03/solution.py b/2015/03/solution.py new file mode 100644 index 0000000..a03a2cc --- /dev/null +++ b/2015/03/solution.py @@ -0,0 +1,110 @@ +#!/bin/python3 +import sys,re +from pprint import pprint +sys.path.insert(0, '../../') +from fred import list2int + +input_f = 'input' + +part = 2 +######################################### +# # +# Part 1 # +# # +######################################### + +if part == 1: + result = 0 + arr = [] + l = 101 + for i in range(0,l): + arr.append([]) + for j in range(0,l): + arr[i].append('O') + + start=int((l-1)/2) + + X = start + Y = start + + with open(input_f) as file: + for line in file: + tmp = list(line.rstrip()) + arr[X][Y] = 'X' + for idx,i in enumerate(tmp): + if i == '^': + Y -= 1 + if i == '>': + X += 1 + if i == '<': + X -= 1 + if i == 'v': + Y += 1 + + arr[X][Y] = 'X' + + for idx,i in enumerate(arr): + for jdx,j in enumerate(i): + if arr[idx][jdx] == 'X': + result += 1 + print(result) + + + + +######################################### +# # +# Part 2 # +# # +######################################### +if part == 2: + result = 0 + arr = [] + l = 101 + for i in range(0,l): + arr.append([]) + for j in range(0,l): + arr[i].append('O') + + start=int((l-1)/2) + + X = start + Y = start + + rX = start + rY = start + + with open(input_f) as file: + for line in file: + tmp = list(line.rstrip()) + arr[X][Y] = 'X' + arr[rX][rY] = 'X' + for idx,i in enumerate(tmp): + if idx % 2 == 0: + if i == '^': + Y -= 1 + if i == '>': + X += 1 + if i == '<': + X -= 1 + if i == 'v': + Y += 1 + else: + if i == '^': + rY -= 1 + if i == '>': + rX += 1 + if i == '<': + rX -= 1 + if i == 'v': + rY += 1 + + arr[X][Y] = 'X' + arr[rX][rY] = 'X' + + for idx,i in enumerate(arr): + for jdx,j in enumerate(i): + if arr[idx][jdx] == 'X': + result += 1 + print(result) + diff --git a/2015/day1/input b/2015/day1/input deleted file mode 100644 index 21497dc..0000000 --- a/2015/day1/input +++ /dev/null @@ -1 +0,0 @@ -(((())))()((((((((())()(()))(()((((()(()(((()((()((()(()()()()()))(((()(()((((((((((())(()()((())()(((())))()(()(()((()(()))(()()()()((()((()(((()()(((((((()()())()((((()()(((((()(())()(())((())()()))()(((((((())(()())(()(((())(()))((())))(()((()())))()())((((())))(()(((((()(())(((()()((()((()((((((((((())(()())))))()))())()()((((()()()()()()((((((())())(((()())()((()()(((()()()))(((((()))(((()(()()()(()(()(((())()))(()(((()((())()(()())())))((()()()(()()(((()))(((()((((()(((((()()(()())((()())())(()((((((()(()()))((((()))))())((())()()((()(()))))((((((((()))(()()(((())())(())()((()()()()((()((()((()()(((())))(()((())()((((((((()((()(()()(((())())())))(())())))()((((()))))))())))()()))()())((()())()((()()()))(()()(((()(())((((())())((((((((()()()()())))()()()((((()()))))))()((((()(((()))(()()())))((()()(((()))()()())())(((())((()()(())()()()(((())))))()())((()))()))((())()()())()())()()(()))())))())()))(())((()(())))(()(())(()))))(()(())())(()(())(()(()))))((()())()))()((((()()))))())))()()())((())()((()()()))()(((()(()))))(())()()))(((()())))))))))(((())))()))())()))))()()(((())))))))()(()()(()))((()))))((())))((()((())))())))()()(()))())()(()((()())(()(()()())())(()()))()))))(()())()()))()()()()))(()(()(()))))))()(()))()))()()(()((())(()(())))()(((())(())())))))()(()(()))))()))(()()()(())()(()(())))()))))()()(((((())))))())()())())())()())()))))()))))))))())()()()()()()())))()))((())()))())))()((())()))))()))())))))))())()()()))()()(()((((()(((((((()(())((()())((()()))()))))(())))()()()(())((())()())))(())))(())))(((()()))()(())(((()(()))((())))())()))((((()))())()))))))))()(())())))(()))()(()()))())()()(())())))())()()(()())))()((()())(()(())(())))))))))))))(()))))()))))))()()())(()(((((()(()())))())()))(()))()))(()()))()())(()))())()(())((()()))))))())))())()(((())))(()(()))()()))()(()))))))((()())(()))))))()())))()()))))))))((((((((()()()(()))))))()())))())))()()((())()))((())(())))())())))()()()((()((()(())))())()(())))))))))()())))()()()()()()))()))((())())(()(()))))))(()()))()))(())))()))))))))))))(()))))))))()))))()))()())()))()()))))))()))))((()))))(()))())()(())))(()())((((()())))()))))(()))()(()()(())))))())))))()))))))())))())))))())))())())))())(()))))(())()(())))())()))((()()))))))())))((())))))))())))(())))))()()())))))())))))()))))))()))()()()(()(((()())())())(()))())))))((()(())(()))))))))(())))()()()())())(()))))()()()))()))())())())()(())))()(((()((((())))))))()))))))))))))))))))))((())()())(()))))()()))))))(()()(())())))())))((())))((())))))))))))))()))))()(()))))))())))))()))(()()())(()())))))))))()))))))(())))))()()))()())(((())))()))(()))))))))(())())))())))())())())()()))((())()(())()())()))()())(())(()))))()())))(()(((()))))))()(()())()()()))()))))))))()()()(())()())()(((((()))()())())(()))))()()()(())))())))()((()())))(()))())()(()())())(()))()()))((()()))((()()()()())))(())()))(()(())))((()()))))))))())))))))())()()))))))))))))))))(())()(())(())()())())()))()(()))))())())))))()())()(()))()()(())))(())())))))(()))))))))))))))())())(())(())))(((()))()))))())((())(()))())))))))())))))())))()))()))))))))))))())()))))()))))((()))(())))()(())))(())()))()))())))())))))))()(()())())))()()())))(())))))(()))))))))))))(()))()))()))())))(((()()()(())((()())))()())(((()))(())()))((()()()())))())(())(()))))()(((((())))(()))())())))))))((((()()()))())())()(()(()())))))))))()())())))(())))()())(((()(())())()()))())())))))))((()())((()()(()))(()(())))()))()))(()))(()))()()(()(((())((((()))()(()))((())()(()(()())()(()))()())))))(()))()))())()())))())))(())))((())(()())))))()))(())(()))()())()(()()((()(()))))))()(())(()())(())()))(((())()))(()()(()()()))))(()(())))()))))())))))())(()()()()()()(((())))(()()))()((())(((((()()())))(()))(()))()()))(((())())()(((()()()()))))(()))(())())))()())(()()())())))))))()))))((())))()())(()))(()(()))())))))())(())))))()()())())()))()()(())))(()))(())((((((())(()))(()))())()))(()()(())))()))(()()))()))()(())))(())))((()(()))(())()()())())))(((()()())(())()))))))()(((()(((((()()(((())(())))())()((()))))((()())()(())(((())))(((()((()(()(()))(()()))())(()))(())(())))()))))))((((()))()((((()(()))()))()()))))()(()(()))()(()((()(((()(()()(((()))))()(((()(()(()(((()(()())())()()(()(()())())(()((((())(()))()))(((((()()())(())()((()()())))()()(((()()))()((((((((()(())))())((()))))(())))(()))))((()((((()()(())(((((()))(((((((((((((()())))((((()(((()((())())()))((()))()(()()((()()()()(()()(()(()(((())()(()((((((()((()()((())()((((()((()()(()()())((()()()((()((())()(()(((()((())((((())(()))((()(()))(()())()((((((((()(((((((((((()))(()(((()(()()()((((())((())()())()))(())((())(()))(((()((()(())))(()))))((()()))))((((()(()(()())(()(())((((((((()((((()((()(((((()))())()(()))(()()((()(())(((((()(())()(((((()()))))))()(((())()(()()((((())()((())((()(((())(((()))((()()((((()(())))))((()((((()((()((()(((())((()))(((((((()(((()((((((((())()))((((())(((((()((((((((()(((()((()(((()()(((()((((((()()(()((((((((()()(()(()(())((((()())()))))(((()))((((())((((()())((()(())()((()((((((()((((((()(())))()())(((())())())()(())()(()())((()()((((())((((((())(()(((((()((((())()((((()(()(())(()())(((())()((())((((()))()((((((())(()(((()(((()((((((()(((()))(()()())())((()((()())()((((())(((()(()(((((((((())(())))()((()()()()(())((()))(((((((()(((((((((()(()))))(()((((((((()((((()((()()((((((()()(((((((()(()(())()(())((()()()((()(((((()())()(((((()())()()((()(()())(()()()(((()()(((((()((((((()()((()(()()()((((((((((((()((((((((()()(((()())))()(((()()(())())((((()((((()((((()()()(())(())((()(()(((((((((((((((()(())(())))))()()))((()(((()(())((()(((()(()()((((()()(((()(((()(((((()()((()(()(((()))((((((()((((((((()((()((())(((((()(((())(())())((()()))((((())()()((()(((()(((((()()(((()))(((()(()(((((((((((((()))((((((((()(((()))))())((((((((((((())((())((()())(((())((())(()((((((((((()(((())((()()(()((())(((((((((((()))((((((((((((()(()())((()((()((()(()(((()((((((((()()(()((()(()(((()))((()))(((((((((((((()(())((((((())(((()(())(()(()(()((()()))((((()((((()((((())))())((((()((((()))((((((()((((((()((()(((())))((())(()))(()((()((((()((()(((()()))((((()()()(((((((())(((())(()))())((((()())(((()(((((((((((()(()(()((()(((((((((((((((()()((((()((((((((()(((()()((()((((()))(((()(())((((((()((((())()((((()((()))(())()(()(((()((())())((((((()(()(())())(((())(()(()())(((((()((()((())()())(())))(((()(())))))))(((()(((()))()((()(((()()((()())()()))())))(((()))(()(((()(((((((((()(()(((((()()(((()())()()))))()(((()))(((()(()(()(()(()))()(())()))(()(((())))(()))))))))))(())((()((())((()(())()(())((()()((((()()((()()))((())(((()((()(())(())))()(()(((((()((()))())()(((((()()(((()(()((((((())(()))(())()))((()(()()))(())())()))(((())))(()((()(((())(())())))((()()((((((((((((((()((()(()()(()(((()))())()()((()()()(())(()))(()())(((())((())()(())()()(()()(())))((()(((()))))(((()()(()()))())((()((())()))((((()()()())((())))(((()(())(((((()(((((()((()(()((((()()(((()()()(((()())(((()()((((())(()))(((()))(())())((()))(((()((()))(((()()((())((()(((((()((((()()())((()))()((((()((()(()()()( diff --git a/2015/day1/part1.py b/2015/day1/part1.py deleted file mode 100644 index e5375aa..0000000 --- a/2015/day1/part1.py +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/python3 - -import sys -from pprint import pprint - -input_f = sys.argv[1] - -result = 0 - -with open(input_f) as file: - for line in file: - for idx,i in enumerate(line): - if i == '(': - result += 1 - if i == ')': - result -= 1 -print(result) diff --git a/2015/day1/part2.py b/2015/day1/part2.py deleted file mode 100644 index d2b842d..0000000 --- a/2015/day1/part2.py +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/python3 - -import sys -from pprint import pprint - -input_f = sys.argv[1] - -result = 0 - -with open(input_f) as file: - for line in file: - for idx,i in enumerate(line): - if i == '(': - result += 1 - if i == ')': - result -= 1 - if result == -1: - print(idx+1) - break -print(result) diff --git a/2015/day1/test b/2015/day1/test deleted file mode 100644 index 13bf1e2..0000000 --- a/2015/day1/test +++ /dev/null @@ -1 +0,0 @@ -))((((( diff --git a/2015/day2/input b/2015/day2/input deleted file mode 100644 index 908022e..0000000 --- a/2015/day2/input +++ /dev/null @@ -1,1000 +0,0 @@ -3x11x24 -13x5x19 -1x9x27 -24x8x21 -6x8x17 -19x18x22 -10x9x12 -12x2x5 -26x6x11 -9x23x15 -12x8x17 -13x29x10 -28x18x6 -22x28x26 -1x5x11 -29x26x12 -8x28x29 -27x4x21 -12x7x16 -7x4x23 -15x24x8 -15x14x2 -11x6x29 -28x19x9 -10x3x1 -5x20x13 -10x25x1 -22x17x7 -16x29x3 -18x22x8 -18x11x19 -21x24x20 -4x7x17 -22x27x12 -1x26x6 -5x27x24 -29x21x3 -25x30x2 -21x26x2 -10x24x27 -10x16x28 -18x16x23 -6x5x26 -19x12x20 -6x24x25 -11x20x7 -4x8x5 -2x13x11 -11x17x1 -13x24x6 -22x29x16 -4x24x20 -10x25x10 -12x29x23 -23x27x12 -11x21x9 -13x2x6 -15x30x2 -8x26x24 -24x7x30 -22x22x8 -29x27x8 -28x23x27 -13x16x14 -9x28x20 -21x4x30 -21x20x20 -11x17x30 -9x14x22 -20x2x6 -10x11x14 -1x8x23 -23x19x19 -26x10x13 -21x12x12 -25x7x24 -1x28x17 -20x23x9 -2x24x27 -20x24x29 -1x3x10 -5x20x14 -25x21x3 -15x5x22 -14x17x19 -27x3x18 -29x23x19 -14x21x19 -20x8x3 -22x27x12 -24x15x18 -9x10x19 -29x25x28 -14x22x6 -4x19x28 -4x24x14 -17x19x17 -7x19x29 -28x8x26 -7x20x16 -11x26x29 -2x18x3 -12x7x18 -11x15x21 -24x7x26 -2x22x23 -2x30x5 -1x19x8 -15x29x10 -15x26x22 -20x16x14 -25x29x22 -3x13x19 -1x12x30 -3x15x27 -19x9x11 -30x8x21 -26x12x20 -11x17x19 -17x25x1 -19x24x12 -30x6x20 -11x19x18 -18x15x29 -18x8x9 -25x15x5 -15x6x26 -13x27x19 -23x24x12 -3x15x28 -17x10x10 -15x4x7 -15x27x7 -21x8x11 -9x18x2 -7x20x20 -17x23x12 -2x19x1 -7x26x26 -13x23x8 -10x3x12 -11x1x9 -1x11x19 -25x14x26 -16x10x15 -7x6x11 -8x1x27 -20x28x17 -3x25x9 -30x7x5 -17x17x4 -23x25x27 -23x8x5 -13x11x1 -15x10x21 -22x16x1 -12x15x28 -27x18x26 -25x18x5 -21x3x27 -15x25x5 -29x27x19 -11x10x12 -22x16x21 -11x8x18 -6x10x23 -21x21x2 -13x27x28 -2x5x20 -23x16x20 -1x21x7 -22x2x13 -11x10x4 -7x3x4 -19x2x5 -21x11x1 -7x27x26 -12x4x23 -12x3x15 -25x7x4 -20x7x15 -16x5x11 -1x18x26 -11x27x10 -17x6x24 -19x13x16 -6x3x11 -4x19x18 -16x15x15 -1x11x17 -19x11x29 -18x19x1 -1x25x7 -8x22x14 -15x6x19 -5x30x18 -30x24x22 -11x16x2 -21x29x19 -20x29x11 -27x1x18 -20x5x30 -12x4x28 -3x9x30 -26x20x15 -18x25x18 -20x28x28 -21x5x3 -20x21x25 -19x27x22 -8x27x9 -1x5x15 -30x6x19 -16x5x15 -18x30x21 -4x15x8 -9x3x28 -18x15x27 -25x11x6 -17x22x15 -18x12x18 -14x30x30 -1x7x23 -27x21x12 -15x7x18 -16x17x24 -11x12x19 -18x15x21 -6x18x15 -2x21x4 -12x9x14 -19x7x25 -22x3x1 -29x19x7 -30x25x7 -6x27x27 -5x13x9 -21x4x18 -13x1x16 -11x21x25 -27x20x27 -14x25x9 -23x11x15 -22x10x26 -15x16x4 -14x16x21 -1x1x24 -17x27x3 -25x28x16 -12x2x29 -9x19x28 -12x7x17 -6x9x19 -15x14x24 -25x21x23 -26x27x25 -7x18x13 -15x10x6 -22x28x2 -15x2x14 -3x24x18 -30x22x7 -18x27x17 -29x18x7 -20x2x4 -4x20x26 -23x30x15 -5x7x3 -4x24x12 -24x30x20 -26x18x17 -6x28x3 -29x19x29 -14x10x4 -15x5x23 -12x25x4 -7x15x19 -26x21x19 -18x2x23 -19x20x3 -3x13x9 -29x21x24 -26x13x29 -30x27x4 -20x10x29 -21x18x8 -7x26x10 -29x16x21 -22x5x11 -17x15x2 -7x29x5 -6x18x15 -23x6x14 -10x30x14 -26x6x16 -24x13x25 -17x29x20 -4x27x19 -28x12x11 -23x20x3 -22x6x20 -29x9x19 -10x16x22 -30x26x4 -29x26x11 -2x11x15 -1x3x30 -30x30x29 -9x1x3 -30x13x16 -20x4x5 -23x28x11 -24x27x1 -4x25x10 -9x3x6 -14x4x15 -4x5x25 -27x14x13 -20x30x3 -28x15x25 -5x19x2 -10x24x29 -29x30x18 -30x1x25 -7x7x15 -1x13x16 -23x18x4 -1x28x8 -24x11x8 -22x26x19 -30x30x14 -2x4x13 -27x20x26 -16x20x17 -11x12x13 -28x2x17 -15x26x13 -29x15x25 -30x27x9 -2x6x25 -10x26x19 -16x8x23 -12x17x18 -26x14x22 -13x17x4 -27x27x29 -17x13x22 -9x8x3 -25x15x20 -14x13x16 -8x7x13 -12x4x21 -27x16x15 -6x14x5 -28x29x17 -23x17x25 -10x27x28 -1x28x21 -18x2x30 -25x30x16 -25x21x7 -2x3x4 -9x6x13 -19x6x10 -28x17x8 -13x24x28 -24x12x7 -5x19x5 -18x10x27 -16x1x6 -12x14x30 -1x2x28 -23x21x2 -13x3x23 -9x22x10 -10x17x2 -24x20x11 -30x6x14 -28x1x16 -24x20x1 -28x7x7 -1x24x21 -14x9x7 -22x8x15 -20x1x21 -6x3x7 -7x26x14 -5x7x28 -5x4x4 -15x7x28 -30x16x23 -7x26x2 -1x2x30 -24x28x20 -5x17x28 -4x15x20 -15x26x2 -1x3x23 -22x30x24 -9x20x16 -7x15x2 -6x21x18 -21x21x29 -29x10x10 -4x3x23 -23x2x18 -29x24x14 -29x29x16 -22x28x24 -21x18x24 -16x21x6 -3x9x22 -9x18x4 -22x9x9 -12x9x13 -18x21x14 -7x8x29 -28x28x14 -1x6x24 -11x11x3 -8x28x6 -11x16x10 -9x16x16 -6x6x19 -21x5x12 -15x17x12 -3x6x29 -19x1x26 -10x30x25 -24x26x21 -1x10x18 -6x1x16 -4x17x27 -17x11x27 -15x15x21 -14x23x1 -8x9x30 -22x22x25 -20x27x22 -12x7x9 -9x26x19 -26x25x12 -8x8x16 -28x15x10 -29x18x2 -25x22x6 -4x6x15 -12x18x4 -10x3x20 -17x28x17 -14x25x13 -14x10x3 -14x5x10 -7x7x22 -21x2x14 -1x21x5 -27x29x1 -6x20x4 -7x19x23 -28x19x27 -3x9x18 -13x17x17 -18x8x15 -26x23x17 -10x10x13 -11x5x21 -25x15x29 -6x23x24 -10x7x2 -19x10x30 -4x3x23 -22x12x6 -11x17x16 -6x8x12 -18x20x11 -6x2x2 -17x4x11 -20x23x22 -29x23x24 -25x11x21 -22x11x15 -29x3x9 -13x30x5 -17x10x12 -10x30x8 -21x16x17 -1x5x26 -22x15x16 -27x7x11 -16x8x18 -29x9x7 -25x4x17 -10x21x25 -2x19x21 -29x11x16 -18x26x21 -2x8x20 -17x29x27 -25x27x4 -14x3x14 -25x29x29 -26x18x11 -8x24x28 -7x30x24 -12x30x22 -29x20x6 -3x17x1 -6x15x14 -6x22x20 -13x26x26 -12x2x1 -7x14x12 -15x16x11 -3x21x4 -30x17x29 -9x18x27 -11x28x16 -22x3x25 -18x15x15 -2x30x12 -3x27x22 -10x8x8 -26x16x14 -15x2x29 -12x10x7 -21x20x15 -2x15x25 -4x14x13 -3x15x13 -29x8x3 -7x7x28 -15x10x24 -23x15x5 -5x7x14 -24x1x22 -1x11x13 -26x4x19 -19x16x26 -5x25x5 -17x25x14 -23x7x14 -24x6x17 -5x13x12 -20x20x5 -22x29x17 -11x17x29 -25x6x4 -29x8x16 -28x22x24 -24x23x17 -16x17x4 -17x8x25 -22x9x13 -24x4x8 -18x10x20 -21x23x21 -13x14x12 -23x26x4 -4x10x29 -2x18x18 -19x5x21 -2x27x23 -6x29x30 -21x9x20 -6x5x16 -25x10x27 -5x29x21 -24x14x19 -19x11x8 -2x28x6 -19x25x6 -27x1x11 -6x8x29 -18x25x30 -4x27x26 -8x12x1 -7x17x25 -7x14x27 -12x9x5 -14x29x13 -18x17x5 -23x1x3 -28x5x13 -3x2x26 -3x7x11 -1x8x7 -12x5x4 -2x30x21 -16x30x11 -3x26x4 -16x9x4 -11x9x22 -23x5x6 -13x20x3 -4x3x2 -14x10x29 -11x8x12 -26x15x16 -7x17x29 -18x19x18 -8x28x4 -22x6x13 -9x23x7 -11x23x20 -13x11x26 -15x30x13 -1x5x8 -5x10x24 -22x25x17 -27x20x25 -30x10x21 -16x28x24 -20x12x8 -17x25x1 -30x14x9 -14x18x6 -8x28x29 -12x18x29 -9x7x18 -6x12x25 -20x13x24 -22x3x12 -5x23x22 -8x10x17 -7x23x5 -10x26x27 -14x26x19 -10x18x24 -8x4x4 -16x15x11 -3x14x9 -18x5x30 -29x12x26 -16x13x12 -15x10x7 -18x5x26 -14x1x6 -10x8x29 -3x4x9 -19x4x23 -28x17x23 -30x7x17 -19x5x9 -26x29x28 -22x13x17 -28x2x1 -20x30x8 -15x13x21 -25x23x19 -27x23x1 -4x6x23 -29x29x24 -5x18x7 -4x6x30 -17x15x2 -27x4x2 -25x24x14 -28x8x30 -24x29x5 -14x30x14 -10x18x19 -15x26x22 -24x19x21 -29x23x27 -21x10x16 -7x4x29 -14x21x3 -21x4x28 -17x16x15 -24x7x13 -21x24x15 -25x11x16 -10x26x13 -23x20x14 -20x29x27 -14x24x14 -14x23x12 -18x6x5 -3x18x9 -8x18x19 -20x26x15 -16x14x13 -30x16x3 -17x13x4 -15x19x30 -20x3x8 -13x4x5 -12x10x15 -8x23x26 -16x8x15 -22x8x11 -12x11x18 -28x3x30 -15x8x4 -13x22x13 -21x26x21 -29x1x15 -28x9x5 -27x3x26 -22x19x30 -4x11x22 -21x27x20 -22x26x7 -19x28x20 -24x23x16 -26x12x9 -13x22x9 -5x6x23 -20x7x2 -18x26x30 -3x6x28 -24x18x13 -28x19x16 -25x21x25 -25x19x23 -22x29x10 -29x19x30 -4x7x27 -5x12x28 -8x26x6 -14x14x25 -17x17x2 -5x27x11 -8x2x2 -3x20x24 -26x10x9 -22x28x27 -18x15x20 -12x11x1 -5x14x30 -7x3x16 -2x16x16 -18x20x15 -13x14x29 -1x17x12 -13x5x23 -19x4x10 -25x19x11 -15x17x14 -1x28x27 -11x9x28 -9x10x18 -30x11x22 -21x21x20 -2x1x5 -2x25x1 -7x3x4 -22x15x29 -21x28x15 -12x12x4 -21x30x6 -15x10x7 -10x14x6 -21x26x18 -14x25x6 -9x7x11 -22x3x1 -1x16x27 -1x14x23 -2x13x8 -14x19x11 -21x26x1 -4x28x13 -12x16x20 -21x13x9 -3x4x13 -14x9x8 -21x21x12 -27x10x17 -6x20x6 -28x23x23 -2x28x12 -8x10x10 -3x9x2 -20x3x29 -19x4x16 -29x24x9 -26x20x8 -15x28x26 -18x17x10 -7x22x10 -20x15x9 -6x10x8 -7x26x21 -8x8x16 -15x6x29 -22x30x11 -18x25x8 -6x21x20 -7x23x25 -8x25x26 -11x25x27 -22x18x23 -3x2x14 -16x16x1 -15x13x11 -3x9x25 -29x25x24 -9x15x1 -12x4x1 -23x30x20 -3x1x23 -6x10x29 -28x13x24 -4x19x17 -6x6x25 -27x29x17 -12x13x2 -10x7x13 -14x15x8 -22x2x3 -27x17x19 -23x10x16 -5x9x25 -9x25x14 -11x18x6 -18x10x12 -9x4x15 -7x16x14 -17x24x10 -11x4x6 -12x9x17 -22x18x12 -6x24x24 -6x22x23 -5x17x30 -6x9x5 -17x20x10 -6x8x12 -14x17x13 -29x10x17 -22x4x5 -10x19x30 -22x29x11 -10x12x29 -21x22x26 -16x6x25 -1x26x24 -30x17x16 -27x28x5 -30x13x22 -7x26x12 -11x24x30 -1x17x25 -22x1x3 -29x24x6 -4x8x24 -13x9x20 -8x12x9 -21x25x4 -23x23x28 -5x2x19 -29x3x15 -22x1x14 -3x23x30 -8x25x3 -15x8x14 -30x14x6 -23x27x24 -19x1x2 -10x9x13 -13x8x7 -8x13x22 -5x15x20 -17x14x8 -5x11x20 -5x10x27 -24x17x19 -21x2x3 -15x30x26 -21x19x15 -2x7x23 -13x17x25 -30x15x19 -26x4x10 -2x25x8 -9x9x10 -2x25x8 -19x21x30 -17x26x12 -7x5x10 -2x22x14 -10x17x30 -1x8x5 -23x2x25 -22x29x8 -13x26x1 -26x3x30 -25x17x8 -25x18x26 -26x19x15 -8x28x10 -12x16x29 -30x6x29 -28x19x4 -27x26x18 -15x23x17 -5x21x30 -8x11x13 -2x26x7 -19x9x24 -3x22x23 -6x7x18 -4x26x30 -13x25x20 -17x3x15 -8x20x18 -23x18x23 -28x23x9 -16x3x4 -1x29x14 -20x26x22 -3x2x22 -23x8x17 -19x5x17 -21x18x20 -17x21x8 -30x28x1 -29x19x23 -12x12x11 -24x18x7 -21x18x14 -14x26x25 -9x11x3 -10x7x15 -27x6x28 -14x26x4 -28x4x1 -22x25x29 -6x26x6 -1x3x13 -26x22x12 -6x21x26 -23x4x27 -26x13x24 -5x24x28 -22x16x7 -3x27x24 -19x28x2 -11x13x9 -29x16x22 -30x10x24 -14x14x22 -22x23x16 -14x8x3 -20x5x14 -28x6x13 -3x15x25 -4x12x22 -15x12x25 -10x11x24 -7x7x6 -8x11x9 -21x10x29 -23x28x30 -8x29x26 -16x27x11 -1x10x2 -24x20x16 -7x12x28 -28x8x20 -14x10x30 -1x19x6 -4x12x20 -18x2x7 -24x18x17 -16x11x10 -1x12x22 -30x16x28 -18x12x11 -28x9x8 -23x6x17 -10x3x11 -5x12x8 -22x2x23 -9x19x14 -15x28x13 -27x20x23 -19x16x12 -19x30x15 -8x17x4 -10x22x18 -13x22x4 -3x12x19 -22x16x23 -11x8x19 -8x11x6 -7x14x7 -29x17x29 -21x8x12 -21x9x11 -20x1x27 -1x22x11 -5x28x4 -26x7x26 -30x12x18 -29x11x20 -3x12x15 -24x25x17 -14x6x11 diff --git a/2015/day2/part1.py b/2015/day2/part1.py deleted file mode 100644 index c5faa2a..0000000 --- a/2015/day2/part1.py +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/python3 - -import sys -from pprint import pprint - -input_f = sys.argv[1] - -result = 0 - -with open(input_f) as file: - for line in file: - tmp = line.rstrip().split('x') - tmp = list(map(int,tmp)) - first = tmp[0] * tmp[1] - second = tmp[1] * tmp[2] - third = tmp[2] * tmp[0] - #2*l*w + 2*w*h + 2*h*l - smallest = min(first,second,third) - #print(first,second, third, smallest) - result = result + (2*first) + (2*second) + (2*third) + smallest - print(result) diff --git a/2015/day2/part2.py b/2015/day2/part2.py deleted file mode 100644 index c18ae81..0000000 --- a/2015/day2/part2.py +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/python3 - -import sys -from pprint import pprint - -input_f = sys.argv[1] - -result = 0 - -with open(input_f) as file: - for line in file: - tmp = line.rstrip().split('x') - tmp = list(map(int,tmp)) - first = tmp[0] * tmp[1] - second = tmp[1] * tmp[2] - third = tmp[2] * tmp[0] - #2*l*w + 2*w*h + 2*h*l - smallest = min(first,second,third) - #print(first,second, third, smallest) - tmp.sort() - rib = tmp[0]+tmp[0]+tmp[1]+tmp[1] - bow = tmp[0]*tmp[1]*tmp[2] - result = result + rib + bow - print(result) diff --git a/2015/day2/test b/2015/day2/test deleted file mode 100644 index 5d2a1f2..0000000 --- a/2015/day2/test +++ /dev/null @@ -1,2 +0,0 @@ -2x3x4 -1x1x10 diff --git a/2015/day3/input b/2015/day3/input deleted file mode 100644 index 55f286f..0000000 --- a/2015/day3/input +++ /dev/null @@ -1 +0,0 @@ -^><^>>>^<^v<<^<><^<^v>^vv<>v>>^^^v<<<^>^<^v<^>^v><<<^>><>v>v^<<^>^<<^^^>v>>v^^>^>vv>>^>>v^>^v>^<^^v>^>^^v^^>v^^v><^><^<<>v^<^<^vv^>>>v^v^>^<>^v<^^vv^>^<>^^<vv<>^>v<^>^v>v^>^v<>^><>>v^v<><>v^v>>>>v^^>^><^^<^>^v^v<>v<<<^<v^^^<^^^>v<^v>>>>>v<^^^^>v<^<>>>>>>v^vvvv^^^v<^v^>v><^>^v<<>>vv^>v>v^^>vv^<^vvv<>><>><><^^^^<^^^<^v>>v>^v^^^>v^^^v>>^v^^<^>>^>^<>>^^<>>^vv>v^<^>>>><><^^v<><<<<^^<>>^<>vv^<^>v^^><^v>^^>v<>^v^<>^vv^>vvv>v>^>^>>^>><>>>^^^^v^<>v^^>^<>v<^^v><^v><>^^^^^v^v>>^^v><<><^^^^><^>v>><<<^v>v^^>^v^<^^v>v<^<<>>^v<<>v<^v^>v^>^v<<v>v>>v>v^^v>^v^>>>><>^>v>^v^>>>>v^<<<>vvv>><^^>^<><^^<^v^v^<^^>^<^v^<<<^^v^v>>><>^^>vv<<^v^<<<<^^>>>v>v<<<>^^>>>v>^>v>vv<<>^<^>^^<^>^v^<>v^><^^^>vv>><^v<^<<<><<^^<><>v>^>^<>>^^v>vv^<^^v>><^vv^<<<>vv^v<^<>v^^>><>^<^v<<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><<>^v>>^^^^<<^v><>^<^>^^v><^^<^^v>v<<^>^>><<^^^vvv<<^vv<^^>v^^vv^<^^<<^^>>^^<v^>>v^^>v<^>^>vv>><v><^<^vv>^^v>^>v<<^vv><^^^^^^><<^>>>^v<>^^v<<<>><<<>^<<v^>^^^<^>^^^v<<>v^><<^^<<^v<<>^v>>vv>><<^v^^>v^v>^^v<><^^^<^^>v>^<>vvv^v^^^>v^^v<^>^^>>^v<><^><^<<^vv^<><<>v^vv^<<<^^>v<<>>>v<>v<><<^v>^^v>^^>v>^>^>v<>><>^>^>^vvvv<^^^^^v>v>><>^>^><>^^>v^^<<><^><<<<>v>^^>^v<<<>vvv>>v<^v>>v>v^<<<>^>^>^<>v<^^vv><^v<<^vv<^<<^^vv^^>vv<^>v>^^<^>v<<^^<^>^^^v^^>>v^vv^<^v>^<>^<^>>^<^v<>v><^^<><>^>v<^<^vv>><^v>^<>^^>^<><<>^<>><<>vvv^<<^^>>v<^>>vv>^v^^^v<>v<>><>^vv^>vv^ diff --git a/2015/day3/part1.py b/2015/day3/part1.py deleted file mode 100644 index b154e22..0000000 --- a/2015/day3/part1.py +++ /dev/null @@ -1,41 +0,0 @@ -#!/bin/python3 - -import sys -from pprint import pprint - -input_f = sys.argv[1] - -result = 0 -arr = [] -l = 101 -for i in range(0,l): - arr.append([]) - for j in range(0,l): - arr[i].append('O') - -start=int((l-1)/2) - -X = start -Y = start - -with open(input_f) as file: - for line in file: - tmp = list(line.rstrip()) - arr[X][Y] = 'X' - for idx,i in enumerate(tmp): - if i == '^': - Y -= 1 - if i == '>': - X += 1 - if i == '<': - X -= 1 - if i == 'v': - Y += 1 - - arr[X][Y] = 'X' - -for idx,i in enumerate(arr): - for jdx,j in enumerate(i): - if arr[idx][jdx] == 'X': - result += 1 -print(result) diff --git a/2015/day3/part2.py b/2015/day3/part2.py deleted file mode 100644 index 340ae93..0000000 --- a/2015/day3/part2.py +++ /dev/null @@ -1,56 +0,0 @@ -#!/bin/python3 - -import sys -from pprint import pprint - -input_f = sys.argv[1] - -result = 0 -arr = [] -l = 101 -for i in range(0,l): - arr.append([]) - for j in range(0,l): - arr[i].append('O') - -start=int((l-1)/2) - -X = start -Y = start - -rX = start -rY = start - -with open(input_f) as file: - for line in file: - tmp = list(line.rstrip()) - arr[X][Y] = 'X' - arr[rX][rY] = 'X' - for idx,i in enumerate(tmp): - if idx % 2 == 0: - if i == '^': - Y -= 1 - if i == '>': - X += 1 - if i == '<': - X -= 1 - if i == 'v': - Y += 1 - else: - if i == '^': - rY -= 1 - if i == '>': - rX += 1 - if i == '<': - rX -= 1 - if i == 'v': - rY += 1 - - arr[X][Y] = 'X' - arr[rX][rY] = 'X' - -for idx,i in enumerate(arr): - for jdx,j in enumerate(i): - if arr[idx][jdx] == 'X': - result += 1 -print(result) diff --git a/2015/day3/test1 b/2015/day3/test1 deleted file mode 100644 index a7e30de..0000000 --- a/2015/day3/test1 +++ /dev/null @@ -1 +0,0 @@ -^v diff --git a/2015/day3/test2 b/2015/day3/test2 deleted file mode 100644 index c59f4bf..0000000 --- a/2015/day3/test2 +++ /dev/null @@ -1 +0,0 @@ -^>v< diff --git a/2015/day3/test3 b/2015/day3/test3 deleted file mode 100644 index 8a6e322..0000000 --- a/2015/day3/test3 +++ /dev/null @@ -1 +0,0 @@ -^v^v^v^v^v