This commit is contained in:
Marcus Ferl 2022-12-17 20:35:26 +01:00
parent 5994d14192
commit 558b05c797
2 changed files with 335 additions and 1 deletions

13
day3.py
View File

@ -1,4 +1,4 @@
import numpy
day = "day3"
file = f"inputs/{day}.txt"
@ -9,7 +9,18 @@ def part_one(file):
result = 0
input = open(file, "r")
input = input.readlines()
newInput = []
for line in input:
temp = 10*line
newInput.append(temp)
print(newInput[0])
startIndex=0
for line in newInput:
if(line[startIndex] == '#'):
result += 1
if startIndex <= len(line) -10:
startIndex +=3

View File

@ -0,0 +1,323 @@
....#..#.................#..#..
#..#.#.#..#.###.#..#...#..#....
.#....#......#.#.#..##...#...#.
.............#.#..#........#.#.
............##.#..#...##.###...
.....#..#......#......##.......
........##........#...........#
..................#..#.........
......#..#...#..#......###..#..
.#....#...........#.....#.##...
..#..#.#........###..#....#...#
..#..##..#..#....#..#......#...
......#....................#...
.........#..#..................
..#.#.....#......#.#....#...#..
..#..........##.......##.##....
#.......#.##.....#...#....#....
####..............###.#....#...
....#........#.#..###..#...#..#
#.#......#...#.##....#.....#...
.......#......#.....#........#.
.##.........#...#.........#....
............#....#.#........#..
#..##..#....#...#.#....#....#..
.....#....##..#................
.#...........#....#..#.....#...
......#.#...#..###.............
#...#...........#..###.#..#..#.
...................#..#....#..#
....#...#...#.#.....#....#.##..
.......#.......#.#.........#...
#..#.......#...#..#.#......#...
..##...........#....#..#.......
.#...............#...##........
.....#..........#............#.
..#.......#.#.#...........#..#.
........#..#.#.#........#.#.##.
.###..............#.#..........
.#....###.....#......#....#....
............#.#......#..#....#.
.#.#.............#........##...
.....#..###....##.....#....#..#
.##....#...#.#.........#......#
....##.......#...............##
..........##.##.......#........
......#....##.........##.#.#.#.
..............#....#..#......#.
......##.........#.........#...
.#...##...##....##..#..#.....#.
.#......#.###.#....#...#......#
.##.......................#..#.
....#......#.##..........#.###.
.#.....##..........#.#.........
....#.#.........#...#..........
.#..##.#....##.......#.......#.
.........#.......#............#
###..........#.....##.#....#...
.......###.#....#........#...##
..#..#....#.......#.#..........
.#..#..........#......#...#....
.....###.#..#.....#...#..#.....
........#.#.#..........#.#..#..
........#...##.................
...#.............#.#..#......##
......#......##......#...#.#..#
.#..#...##..........#...##.....
..#.#....####..#...#....##....#
.#..##.........#..##......#....
#....#.#.........#.............
....###..............#....#....
....#..#..#...###..#.#..#.#....
....#.....#...........###..#...
....#.#.....#...#.....#.......#
..#.......#..................#.
#...................##.........
....#.#.#.#.#.....#.....#......
...............##..#..##.#...##
..#.....#.....##.........#..#..
...#...#.....#..##..##....#..##
..#.................#....#...#.
#....##...............##..#....
..#.....#.....##.........##...#
..#.###..............#...#.....
.......................#.......
#...#..#.....##...#...#........
..........#......#.###....#...#
..#.....#.##.#..#.#.......#....
#.##...#............#..........
#........#.#.#..#...#..#.....##
#............#.#...............
.#..#.......#.#.....#.#......##
.#.#....#........#..##.........
..#....#......#.#...##...#.....
##.....#......................#
...#.......#..##.....#........#
......##..#...............##...
.....#...#......##....#.#......
.#...#....#.#.#........#...#.#.
.......#...#...##...#..........
.##..#..##........##....###.#..
..##........#........##........
............#....#......#......
.......#...........#.......#...
#.#......##.#...#....#.#.....#.
..#.#.#......##........#....#..
#.#.####.#..#..........#.......
......................#.#......
...#.......#.....#......#..#.#.
...#....#....##..........#..##.
......#......#....#.........#..
.........#....#...#.#.........#
.....#...##.#.#.#......#.....#.
........#...#......#.#....#....
.....#.........#.............#.
.#...........#.#....##.......#.
.#..#......#....#....#....#....
#.......#.#.#.#..#.......#.....
..#...#...#......#.............
.....#.......#..#.........##..#
#..##...........#.#.........#..
#..#..........#....#......#...#
#...#............#....##..#.##.
....#.#..#....#.........##..##.
.........#..........#.......##.
#...#........................#.
....#....#..#...........##...#.
.....###.###.#....#.....#.....#
.#..###..#...##..........#.....
#..#.....#...#........#........
.#..##..#......#.....#......##.
#.....##........#.#..#....#.#..
.#....#...#..#...............#.
..........#.#........#.....#...
..#.#.....#....#........#.###..
...#..#...#.##.....#..........#
..#......##....................
.....#...#....#..#....#.......#
......#............#....#...#..
.#..#....#.....#........##.....
...#..#.......#...............#
##.#..#...............#.#..##..
..#.........#.####.####........
.........#...#.#........#..###.
..###.....#.........##........#
#..##.....##.#..........#....##
.#..#....###..#.....##..#......
#...#..#........#.............#
#.#....#........#.........#.###
.....#....#.###.......#........
...........#............#..#...
..........#.#..##......###....#
..##....#...........#....#....#
..#...##.#.......#.##.......#..
.......#......#..........#....#
.........#..#..............####
#.#...#...#......#...#..#...#.#
.#.#...#.....#.......#.#..##.#.
......##..##...#...............
....#....#...##.......#.#......
.............................#.
..##...#.......#......#.......#
.#.##.##....#......##.......#..
.......##..#....#.##.#.#.......
....#.............#......#..#..
...#.........#....#..#.....#.#.
......#......#......#.........#
........#..#.#.....#.....#...#.
.#.......#.........#...#.......
#.#.##.....#...#...............
..#.......##.....#............#
.................##.#..#.....##
........#.###....#.......##.#..
....#.#..#..#.......#.#....#..#
.#..#..#..#...##....#..#.....#.
...#..#...#..........#........#
...........##....#...##.#...###
.##..#.......##.....##....#....
...#.#..#..#..##..#.....##.....
.#.....#..........#...#........
.....#..#.#..#.................
..#.......#..#.....##.......#..
............##.##.....#...#....
#......#......................#
...#..........#...#...#..#.....
......##..............##.##....
................##......#.###..
.###...#..........#...........#
#....#...#.........##......#...
.............#...............#.
.###.....#......#...#.......#..
......##..#.#.#.....#........#.
..#.#..........#.#......##.....
.#.#...#.#.....#.#..#.....#....
.......#....#.#....##..........
#.........#........####.#......
...#..#.....#..............#.#.
...#..........................#
..##....#..#..........#....#...
..##.##.#.#.#......#..#........
...#..#.#.#..#........#.......#
.....#.....#..#...#........##..
..#..#...........#...##..##..#.
#.....#.....#..#..##........#..
...#..............#......#..#..
...#.#...........###...#.#.....
..........................#.#..
....#........#..#..........#.#.
.#..#..........#.#..........#..
....#.........#......#.#....#..
..#........#.................#.
...#......#............#.......
...#.#...#..##....#........#...
......##.#....#.#......#.......
........#..........#........#..
###..#.....#...#......#...###..
..##...#..###............#...#.
#.......#..#..#............##..
#........####......#...........
#..#..#...........#.......####.
......#..##................#...
.....#..##......#.#...#..#.....
......#.....##.....#.###.......
.#.....#.........#.......#.#..#
.##...........###...#....#...#.
.#....#..#....#.##...#.........
.................##............
......#......#.............#...
.........##.#........#....#...#
..##....#.......#....##.#......
.......#.#.#.....##..#.#.......
......#.#.#.#......#...#.......
....##...#.....#..#......#.....
..............#......#.##......
#.##..###........#.##........##
#..#.........#.#......#.#......
.#..###.......#................
..............#...#..##.#.#....
.....#..#........#...##.#...#..
.#...##.....#........#..###.#..
....#.....#...#........#.......
....#.##.....#....#............
#.#..#....#....#............#..
....#....#...#.#...#...######..
.##.........#..#.....#.....#...
..##...............#...........
........##...#........#..#.....
...#................###.##..##.
.#..#..#..#...#.............#..
#.....#..##.#....#.#......#..#.
...#...#...#.....#...#...#.....
..##.###..#..#...##...........#
.#.......##........#.#..#..#...
..#.......#.###................
..#...#........##...#..#......#
...#...#............#.#......#.
..#...#.....#.#.#.#........#...
.#........#......##....##...#..
...#..##....#.........#....#.#.
....#........##...............#
.###.....#...#..#.#.....#.....#
..#...#..................#...##
#..#....###....................
...........#...#...........#...
........#.....#................
#........#...........#........#
........#..#....#...#....#..#..
#.#....#......#.......##.......
.#.....##..#...#......#.#.#....
..#..##.#.....#...#.#......#.#.
.##....#...#....#......##......
.#..#..#...##.##..#.#..#.......
.....#.#...........#.#........#
.#...#....#..................#.
...........#...#.........#.....
.#..###........##......#..#...#
.............###..##.....#.#..#
.#..#..........#......#........
..#........#.#...#.......##.#..
....#...........##......#...#..
...........#....#.....#...#.#..
...#...........#.....#.#..#..#.
......#.......#................
##.......#.....#............#.#
.##.....#.#.#..................
..........#.....##..#.#.#......
.###.#.....##...#..#.#........#
#....#........##..#..#.........
.............#.........##..#...
......##.#...#.#.#....##.......
.#.......###.#.###..##........#
..##.....#..#.............#..#.
.#...#......#.#.............#..
..##.#...#.........##....#...#.
...........#......#.#..........
.....#..#...##.....#....#..#...
#...................##...#.....
..#.................#.....#....
..............#..#.#...###.....
.......#........#...#.....#....
.............#.......#...##..#.
.#...#..#...#..#.....#......#.#
....#..#..#...#...........#....
.....#..#......##.##....#..#...
...#......#..#.#...#.....#.....
.......##..#.#.......#..#....##
#.#..#....##.##.#.#..........#.
..........#..........#....##.#.
....#.................#...#..#.
...#.....#..#...#.#...#..#.....
....#.#..###....#.............#
#....#..#.#..........#..#..#...
...#..#......#...#...#...#...#.
##....#.......#..........#.....
#......#.........#...#.........
##...##.#....#....#..#..#.#....
....#..#.....#.##.#.......#.#..
..##....##....#...#..####...#.#
..##..........#.............#..
..#......#..............#......
...#......#..#.#...#.......#...
.#............#....#...##.##..#
..##..........#...........#..#.
..#..##..#....#..#.#..#..#..#..