diff --git a/day3.py b/day3.py index 0e6fddc..f3e4bdc 100644 --- a/day3.py +++ b/day3.py @@ -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 diff --git a/inputs/day3.txt b/inputs/day3.txt index e69de29..e68e9d2 100644 --- a/inputs/day3.txt +++ b/inputs/day3.txt @@ -0,0 +1,323 @@ +....#..#.................#..#.. +#..#.#.#..#.###.#..#...#..#.... +.#....#......#.#.#..##...#...#. +.............#.#..#........#.#. +............##.#..#...##.###... +.....#..#......#......##....... +........##........#...........# +..................#..#......... +......#..#...#..#......###..#.. +.#....#...........#.....#.##... +..#..#.#........###..#....#...# +..#..##..#..#....#..#......#... +......#....................#... +.........#..#.................. +..#.#.....#......#.#....#...#.. +..#..........##.......##.##.... +#.......#.##.....#...#....#.... +####..............###.#....#... +....#........#.#..###..#...#..# +#.#......#...#.##....#.....#... +.......#......#.....#........#. +.##.........#...#.........#.... +............#....#.#........#.. +#..##..#....#...#.#....#....#.. +.....#....##..#................ +.#...........#....#..#.....#... +......#.#...#..###............. +#...#...........#..###.#..#..#. +...................#..#....#..# +....#...#...#.#.....#....#.##.. +.......#.......#.#.........#... +#..#.......#...#..#.#......#... +..##...........#....#..#....... +.#...............#...##........ +.....#..........#............#. +..#.......#.#.#...........#..#. +........#..#.#.#........#.#.##. +.###..............#.#.......... +.#....###.....#......#....#.... +............#.#......#..#....#. +.#.#.............#........##... +.....#..###....##.....#....#..# +.##....#...#.#.........#......# +....##.......#...............## +..........##.##.......#........ +......#....##.........##.#.#.#. +..............#....#..#......#. +......##.........#.........#... +.#...##...##....##..#..#.....#. +.#......#.###.#....#...#......# +.##.......................#..#. +....#......#.##..........#.###. +.#.....##..........#.#......... +....#.#.........#...#.......... +.#..##.#....##.......#.......#. +.........#.......#............# +###..........#.....##.#....#... +.......###.#....#........#...## +..#..#....#.......#.#.......... +.#..#..........#......#...#.... +.....###.#..#.....#...#..#..... +........#.#.#..........#.#..#.. +........#...##................. +...#.............#.#..#......## +......#......##......#...#.#..# +.#..#...##..........#...##..... +..#.#....####..#...#....##....# +.#..##.........#..##......#.... +#....#.#.........#............. +....###..............#....#.... +....#..#..#...###..#.#..#.#.... +....#.....#...........###..#... +....#.#.....#...#.....#.......# +..#.......#..................#. +#...................##......... +....#.#.#.#.#.....#.....#...... +...............##..#..##.#...## +..#.....#.....##.........#..#.. +...#...#.....#..##..##....#..## +..#.................#....#...#. +#....##...............##..#.... +..#.....#.....##.........##...# +..#.###..............#...#..... +.......................#....... +#...#..#.....##...#...#........ +..........#......#.###....#...# +..#.....#.##.#..#.#.......#.... +#.##...#............#.......... +#........#.#.#..#...#..#.....## +#............#.#............... +.#..#.......#.#.....#.#......## +.#.#....#........#..##......... +..#....#......#.#...##...#..... +##.....#......................# +...#.......#..##.....#........# +......##..#...............##... +.....#...#......##....#.#...... +.#...#....#.#.#........#...#.#. +.......#...#...##...#.......... +.##..#..##........##....###.#.. +..##........#........##........ +............#....#......#...... +.......#...........#.......#... +#.#......##.#...#....#.#.....#. +..#.#.#......##........#....#.. +#.#.####.#..#..........#....... +......................#.#...... +...#.......#.....#......#..#.#. +...#....#....##..........#..##. +......#......#....#.........#.. +.........#....#...#.#.........# +.....#...##.#.#.#......#.....#. +........#...#......#.#....#.... +.....#.........#.............#. +.#...........#.#....##.......#. +.#..#......#....#....#....#.... +#.......#.#.#.#..#.......#..... +..#...#...#......#............. +.....#.......#..#.........##..# +#..##...........#.#.........#.. +#..#..........#....#......#...# +#...#............#....##..#.##. +....#.#..#....#.........##..##. +.........#..........#.......##. +#...#........................#. +....#....#..#...........##...#. +.....###.###.#....#.....#.....# +.#..###..#...##..........#..... +#..#.....#...#........#........ +.#..##..#......#.....#......##. +#.....##........#.#..#....#.#.. +.#....#...#..#...............#. +..........#.#........#.....#... +..#.#.....#....#........#.###.. +...#..#...#.##.....#..........# +..#......##.................... +.....#...#....#..#....#.......# +......#............#....#...#.. +.#..#....#.....#........##..... +...#..#.......#...............# +##.#..#...............#.#..##.. +..#.........#.####.####........ +.........#...#.#........#..###. +..###.....#.........##........# +#..##.....##.#..........#....## +.#..#....###..#.....##..#...... +#...#..#........#.............# +#.#....#........#.........#.### +.....#....#.###.......#........ +...........#............#..#... +..........#.#..##......###....# +..##....#...........#....#....# +..#...##.#.......#.##.......#.. +.......#......#..........#....# +.........#..#..............#### +#.#...#...#......#...#..#...#.# +.#.#...#.....#.......#.#..##.#. +......##..##...#............... +....#....#...##.......#.#...... +.............................#. +..##...#.......#......#.......# +.#.##.##....#......##.......#.. +.......##..#....#.##.#.#....... +....#.............#......#..#.. +...#.........#....#..#.....#.#. +......#......#......#.........# +........#..#.#.....#.....#...#. +.#.......#.........#...#....... +#.#.##.....#...#............... +..#.......##.....#............# +.................##.#..#.....## +........#.###....#.......##.#.. +....#.#..#..#.......#.#....#..# +.#..#..#..#...##....#..#.....#. +...#..#...#..........#........# +...........##....#...##.#...### +.##..#.......##.....##....#.... +...#.#..#..#..##..#.....##..... +.#.....#..........#...#........ +.....#..#.#..#................. +..#.......#..#.....##.......#.. +............##.##.....#...#.... +#......#......................# +...#..........#...#...#..#..... +......##..............##.##.... +................##......#.###.. +.###...#..........#...........# +#....#...#.........##......#... +.............#...............#. +.###.....#......#...#.......#.. +......##..#.#.#.....#........#. +..#.#..........#.#......##..... +.#.#...#.#.....#.#..#.....#.... +.......#....#.#....##.......... +#.........#........####.#...... +...#..#.....#..............#.#. +...#..........................# +..##....#..#..........#....#... +..##.##.#.#.#......#..#........ +...#..#.#.#..#........#.......# +.....#.....#..#...#........##.. +..#..#...........#...##..##..#. +#.....#.....#..#..##........#.. +...#..............#......#..#.. +...#.#...........###...#.#..... +..........................#.#.. +....#........#..#..........#.#. +.#..#..........#.#..........#.. +....#.........#......#.#....#.. +..#........#.................#. +...#......#............#....... +...#.#...#..##....#........#... +......##.#....#.#......#....... +........#..........#........#.. +###..#.....#...#......#...###.. +..##...#..###............#...#. +#.......#..#..#............##.. +#........####......#........... +#..#..#...........#.......####. +......#..##................#... +.....#..##......#.#...#..#..... +......#.....##.....#.###....... +.#.....#.........#.......#.#..# +.##...........###...#....#...#. +.#....#..#....#.##...#......... +.................##............ +......#......#.............#... +.........##.#........#....#...# +..##....#.......#....##.#...... +.......#.#.#.....##..#.#....... +......#.#.#.#......#...#....... +....##...#.....#..#......#..... +..............#......#.##...... +#.##..###........#.##........## +#..#.........#.#......#.#...... +.#..###.......#................ +..............#...#..##.#.#.... +.....#..#........#...##.#...#.. +.#...##.....#........#..###.#.. +....#.....#...#........#....... +....#.##.....#....#............ +#.#..#....#....#............#.. +....#....#...#.#...#...######.. +.##.........#..#.....#.....#... +..##...............#........... +........##...#........#..#..... +...#................###.##..##. +.#..#..#..#...#.............#.. +#.....#..##.#....#.#......#..#. +...#...#...#.....#...#...#..... +..##.###..#..#...##...........# +.#.......##........#.#..#..#... +..#.......#.###................ +..#...#........##...#..#......# +...#...#............#.#......#. +..#...#.....#.#.#.#........#... +.#........#......##....##...#.. +...#..##....#.........#....#.#. +....#........##...............# +.###.....#...#..#.#.....#.....# +..#...#..................#...## +#..#....###.................... +...........#...#...........#... +........#.....#................ +#........#...........#........# +........#..#....#...#....#..#.. +#.#....#......#.......##....... +.#.....##..#...#......#.#.#.... +..#..##.#.....#...#.#......#.#. +.##....#...#....#......##...... +.#..#..#...##.##..#.#..#....... +.....#.#...........#.#........# +.#...#....#..................#. +...........#...#.........#..... +.#..###........##......#..#...# +.............###..##.....#.#..# +.#..#..........#......#........ +..#........#.#...#.......##.#.. +....#...........##......#...#.. +...........#....#.....#...#.#.. +...#...........#.....#.#..#..#. +......#.......#................ +##.......#.....#............#.# +.##.....#.#.#.................. +..........#.....##..#.#.#...... +.###.#.....##...#..#.#........# +#....#........##..#..#......... +.............#.........##..#... +......##.#...#.#.#....##....... +.#.......###.#.###..##........# +..##.....#..#.............#..#. +.#...#......#.#.............#.. +..##.#...#.........##....#...#. +...........#......#.#.......... +.....#..#...##.....#....#..#... +#...................##...#..... +..#.................#.....#.... +..............#..#.#...###..... +.......#........#...#.....#.... +.............#.......#...##..#. +.#...#..#...#..#.....#......#.# +....#..#..#...#...........#.... +.....#..#......##.##....#..#... +...#......#..#.#...#.....#..... +.......##..#.#.......#..#....## +#.#..#....##.##.#.#..........#. +..........#..........#....##.#. +....#.................#...#..#. +...#.....#..#...#.#...#..#..... +....#.#..###....#.............# +#....#..#.#..........#..#..#... +...#..#......#...#...#...#...#. +##....#.......#..........#..... +#......#.........#...#......... +##...##.#....#....#..#..#.#.... +....#..#.....#.##.#.......#.#.. +..##....##....#...#..####...#.# +..##..........#.............#.. +..#......#..............#...... +...#......#..#.#...#.......#... +.#............#....#...##.##..# +..##..........#...........#..#. +..#..##..#....#..#.#..#..#..#.. \ No newline at end of file