diff --git a/2020/20/input.txt b/2020/20/input.txt new file mode 100644 index 0000000..bede187 --- /dev/null +++ b/2020/20/input.txt @@ -0,0 +1,1727 @@ +Tile 3583: +.##..#..#. +....##.... +##..#..#.. +.....#.... +.#..#..... +#.#....... +#.....#..# +....#....# +...#.##.#. +.#....##.# + +Tile 3967: +..###..#.. +#......... +.........# +#...#....# +....#....# +#...#....# +#..#...#.# +##....##.. +#....#.... +##.###.#.. + +Tile 3307: +.#.#...#.. +......#..# +.........# +##.....##. +..#.....#. +.#...####. +#....#.#.# +......##.# +#.##.#..## +.....#.##. + +Tile 1741: +.##..#.#.. +#..##.#... +.#.....#.. +...####.## +#.#..###.. +####.#.... +..#.##.#.. +#.....#.#. +#.###..... +####...### + +Tile 3821: +.#######.# +...#...... +#.##.#...# +.#...##### +....#.##.. +#.#.#..... +##......## +#..#.....# +##..#..#.# +###..#.#.. + +Tile 1787: +..##.#.### +...##..#.# +#..#.###.# +..#.##..#. +#.#.....## +...#...#.# +#..##..#.# +##.#.##..# +...#..#... +..#..##... + +Tile 2281: +..#.#.##.# +.......##. +..#..#..#. +....#.#..# +#...#.##.# +#..#.##.#. +#.#....#.# +#....##... +.....#..## +...#.#...# + +Tile 3593: +...#..#..# +.........# +.........# +#.#..#...# +##......## +##........ +...#.#...# +#...#...## +...#.#.#.. +#..#...... + +Tile 3259: +.####..... +....#.#.## +#....#..## +#........# +.....#.... +.#.....#.# +...##....# +#.....#.#. +#.#..#.... +#.#..##.#. + +Tile 2663: +.####..### +#.#..##... +#..#...#.. +#..#....#. +..#.##...# +.#....#.#. +#..#....#. +#.#....... +.#.#...... +..#..##### + +Tile 3833: +####....#. +.......#.# +.#........ +#...#.##.# +#.##.#.#.# +...#.....# +##...#...# +#.#.##...# +##.#.#.##. +.##.###.## + +Tile 3373: +#.....##.# +#...###..# +..#.#..#.. +####..#.## +#...#.##.# +#..##.#... +#..##...## +#.####.... +##..#...#. +##.##.#.## + +Tile 1511: +.#.###...# +#....#...# +.##.#..... +...##.###. +#.##.##..# +####.#..## +#..#.#.... +#.......#. +#......#.# +###...#... + +Tile 1723: +...##..#.# +..#..#...# +.##.....#. +#..#...... +.#..#.#..# +.#........ +...#.#..## +##.......# +..#..###.. +#####...## + +Tile 1543: +#..#.##.## +#.....#..# +.....#.#.# +###....... +...##....# +..#..#...# +#.....##.# +#.#..##.## +...###.... +###.#...#. + +Tile 1433: +##.##..##. +###....#.# +..#.....## +.#.##..#.. +.#.#...### +#.#.....#. +..##.....# +#....#.... +..#.#...#. +.#...##### + +Tile 1949: +#.#..##..# +.........# +.#.......# +#..##..### +........## +#........# +.....#...# +...####.#. +.#...##... +###.#.#..# + +Tile 3889: +###...#### +#....##..# +.#.###...# +##..#..... +.....#.... +....#.#.#. +.........# +#....##..# +##.##..##. +#.###.#### + +Tile 2477: +.....#..## +#.##.###.. +###..#...# +.#....#.#. +#..#...... +...#.....# +##.....#.. +..##.....# +.##.#....# +#####.#### + +Tile 2137: +..######## +#..#...... +...#.##..# +#.#..#...# +.#..#...## +##.....#.# +.#....##.. +.##....... +.#..####.. +#..###...# + +Tile 3313: +..####.#.# +#..#.....# +#....#.... +..##..##.. +#....##... +.......... +#......... +.......### +##........ +.###...### + +Tile 1493: +#..####.## +##.#..#... +#.#.....## +.##......# +.##...#..# +#..##....# +#.#.#.#.#. +#.#...#..# +#.#.#....# +#.####...# + +Tile 1579: +.##..##.## +#.#....... +.......#.. +..#...##.. +#..####... +.#.#.##.## +###.#..... +#....##.## +....#...## +##....#.#. + +Tile 2221: +.#.#...... +.......##. +#..#.#...# +..###.###. +....#...## +##.#..##.. +..##.#.#.. +......#### +..##.#.#.. +.###..#.## + +Tile 3643: +..###...#. +#..#..#..# +.##....... +#..###.... +##...##.## +#...#...#. +###......# +....#..#.# +.#.#.....# +..#..#.#.. + +Tile 3881: +###.##.##. +.####..### +#.###..##. +....#...#. +##...#..#. +#........# +....#...#. +...#.....# +.#.....##. +.####..#.# + +Tile 3823: +..#.##..## +#...#....# +..#...#... +#.#.##...# +.####....# +.#...#...# +.......... +.........# +...#..#... +....#..#.# + +Tile 3181: +####..##.# +#.....##.# +#.......## +.......#.# +..#..##.#. +##..#..#.. +...##..... +.........# +....#.##.. +.##.###.#. + +Tile 2837: +.###.#.### +#.##..#.## +.....##... +###......# +##.......# +........## +##.##..#.. +....###... +.......... +#......#.# + +Tile 2063: +..#####... +.......... +........#. +..##.....# +###...#.#. +#.#.....#. +.....#..## +#.......#. +##....##.. +#.##.###.# + +Tile 1187: +#...##..## +#........# +#.#....... +...#.#.... +.....#.#.# +#....#.... +..###..... +.#........ +..#...###. +####.#.#.# + +Tile 3137: +...###..#. +#.##.....# +..#...#..# +#..#.....# +......#... +#.....##.# +...#...... +#.#.#.#### +..#....#.. +.#..#.#.## + +Tile 2411: +#.....##.. +.......#.# +.....##... +#.#....... +#..##....# +.##.##.... +.##...##.. +#.#....... +##.....#.# +.##.###... + +Tile 2713: +..#.#.#### +...####.#. +##..#...#. +#..##..... +#...#..... +.#...#.### +.......... +#.#.##..#. +#.#..#..#. +.#..##.#.# + +Tile 1103: +##.#...##. +#.....##.. +...###..#. +..##.....# +.####..#.. +..#.###.#. +##.....#.. +.#..#....# +#........# +####...##. + +Tile 3943: +.###...... +#...#.#... +..##..#..# +.##..#.#.# +.......... +##...#.... +#..#...#.. +#..###...# +###....### +#.#....### + +Tile 1871: +##.#...##. +#......#.. +.#.##..... +.#####.#.. +#.#....#.. +#..#....## +#..####.#. +#....#.... +...#.....# +...#.##.#. + +Tile 3407: +#.#.#####. +##.#..#..# +.###.#.#.# +..#....... +##.###.#.. +.....#.### +#.#....... +##..#.#..# +#.#.##.#.# +#..#..###. + +Tile 2441: +#####.#..# +...#.#.... +..#...#..# +.##....#.. +#.##..#... +.##.#..#.# +##.......# +.##..#.... +.......#.. +.#..#.###. + +Tile 3637: +.#..##.#.# +...##..#.. +#.#.###... +#....#...# +..#.....## +#....#...# +#..#.#.#.. +....#..#.# +....#.#..# +.#.###.##. + +Tile 1549: +....##.##. +.#....#... +..####.#.. +....#.#..# +#........# +..#....... +.#.#....## +...######. +#...##.... +.#...##... + +Tile 1481: +...##.##.. +#...#.##.. +#..#..#.#. +#.#.#...#. +#...#.##.. +.##....#.. +#........# +....#.#... +#.#.....## +#.....#### + +Tile 1559: +#..#....#. +..#.##.#.# +#.....#.## +.###.#...# +..####..## +#..#.#..#. +#.#...###. +#.....#.#. +.#.....#.. +#..####.#. + +Tile 2251: +#..#.....# +.#..#..... +#.#....#.. +#....##..# +##....#..# +..#..#.... +#.#.#.#... +#...#....# +###..#.##. +##..#.#### + +Tile 2897: +...###.... +##..#....# +.........# +.#.......# +...#.....# +..#..#...# +.#...#...# +#....#.... +.#......## +..##...##. + +Tile 2239: +#..###..#. +.#.......# +.#..#..#.. +#.##....## +#....#.#.# +##..#..... +#........# +...##.#..# +#...###..# +...#.#.### + +Tile 2593: +.#....##.# +##......## +..#..##... +.#..#..... +...#.#...# +#.#..#.#.. +......#.#. +#...##...# +###..##..# +#.#####.## + +Tile 3697: +##.######. +###....#.. +#.....##.# +##...#..## +#.....#..# +.#.#..#... +#......##. +#.#.#.#.#. +.........# +....####.. + +Tile 3739: +##.#...... +.#.....#.# +..#.....## +#....##... +##.#...#.. +###.#...## +.#...#.### +.#..#.##.# +..#..#..#. +...#.##... + +Tile 2459: +.#.####... +#..#...#.. +.....#.##. +..#....##. +#......##. +##...#..## +#....#.... +###...#..# +###.##.### +.....##... + +Tile 2939: +##.#.#.... +#..#.##### +#...###.#. +..#...#.## +.#.....##. +###....#.. +.##...#..# +.....#.#.. +..#..#.... +..##..#.## + +Tile 2347: +.###..#..# +##......#. +#......#.. +#...#....# +#......#.. +##.......# +..#....... +#.##..#... +#..#..###. +#....##..# + +Tile 2381: +######.... +##.......# +.#....###. +#.##.##.#. +#.#..#.... +.........# +....#..#.# +#####..... +..##....## +#..###...# + +Tile 2503: +#.#...###. +#...#..#.. +.##.#.#.## +.#.....#.. +#...##.... +##.#.....# +...#..#..# +..#.##...# +......#... +##..#..##. + +Tile 3023: +.#...#.... +#.##...#.. +##....#... +.#..#..... +.#.#.....# +#.#....... +##..#.#.#. +#...#.#... +...#..#.## +#...##.### + +Tile 3851: +#..##.#.#. +#...#....# +###..#.... +#.#.#...## +..#.#..#.# +#.......#. +..#.....## +.......... +#.#.#.#..# +..#.##..#. + +Tile 1009: +.####.##.. +#......... +.#.#...... +..#.#..... +#......##. +###....... +#.#....... +.......#.# +.#....#.## +#.####.#.# + +Tile 1151: +.#.##..#.. +..#......# +##....##.# +#......### +##.....#.. +##..#.#..# +...#...... +.##...##.. +##..###..# +######.### + +Tile 2683: +#..#.#..## +.#....#.#. +#...##.... +....###... +...#..#... +..#....... +...#...#.. +....#.#... +..#..#...# +..#.#.##.. + +Tile 3323: +#.#..##.## +#.#....### +#.##.###.# +##....#... +##..#..... +###.#.#.## +#......#.# +..#....##. +#......#.# +.##...#..# + +Tile 2333: +##.#..#..# +#..##..... +.........# +.#.#.#.... +#...##...# +#.#.#....# +..#.###..# +....###.#. +#...#....# +..#.....#. + +Tile 2543: +#..###.#.. +....#..#.# +..#...#.#. +#...##...# +.#.....### +.......... +#..#....#. +#....#..#. +#.#..##..# +##...#..## + +Tile 1483: +###..##..# +.#......#. +.......#.# +#........# +...#...#.# +#.#.#..... +#......#.# +#...#.#... +#...####.. +#.##..#..# + +Tile 2027: +.#..#....# +....##.... +....#...## +#.#..#.... +#.#.....## +.......#.# +#...#..... +.##....#.# +###.#.##.# +.###.#.### + +Tile 1699: +#.###..##. +..#.###... +.........# +.#.#..#..# +...##.##.. +#........# +.......#.# +##..#...## +.....#.... +#########. + +Tile 2843: +#...#.#### +....#.##.. +...#....#. +.....#.... +#..##..... +.....#.... +###.#..... +......#..# +#.#.#...## +#...##.##. + +Tile 1597: +#..####### +.......... +.#........ +#..##.#... +##.....#.. +##.###...# +.....###.# +...##.#..# +#....#...# +##.#.##### + +Tile 2311: +.#.#.#.### +.#.......# +..#...#.## +#..#....## +#...#..... +.........# +.#.#...##. +.#.##....# +..#..#...# +...##.#.#. + +Tile 1889: +#.###.###. +.#...#...# +#........# +#......#.# +..#......# +#......### +.....#.##. +#.....#..# +........## +####...#.# + +Tile 3581: +........## +.#...#...# +###.....#. +.......... +#.#......# +......#..# +##........ +..#...#### +#..#...... +.##.###.## + +Tile 1499: +##.#.#.... +.##...##.. +##.....##. +###.#...## +..##....#. +.#....#... +#..#...##. +..#....##. +.#.....#.. +..#.####.# + +Tile 2999: +.#.###..#. +#.#...#... +##.#...... +...#..#... +..###..### +...#.#..#. +#..##.#..# +.........# +..#....##. +..#.###.#. + +Tile 1487: +#....#.... +.#.....#.. +.#.#.....# +#.#......# +#.#.##.... +#.....#... +.....#.... +##........ +##..##...# +#.#..#...# + +Tile 2969: +#..#.#..## +###..#...# +.#..#..... +...####.#. +#.#.##..#. +...###...# +#...#..... +..#...##.. +##..#.#..# +#..#.###.# + +Tile 1873: +..###.#.#. +..#.###.#. +#.#.##...# +.#...#...# +....#..... +##.....##. +.....#.#.. +..#..#..#. +..##..#..# +##...#.... + +Tile 2029: +#.#...#### +#....##... +.#.#...##. +#####.#.#. +#..#...... +#...#..#.. +#.#.#..#.# +#......#.# +...####.#. +..##.#.### + +Tile 3517: +.##...##.. +.#......#. +....##.... +#.##..#..# +.......##. +#..#...... +...##...#. +........## +#...#....# +..######.# + +Tile 2803: +#.##.###.. +.#..##...# +...##..... +.#.#.#.#.. +#.......#. +.##.#.#..# +.#.###.#.. +.#..#...## +#...###... +.###..#.## + +Tile 1237: +.######.## +#.#....... +....#....# +.....#...# +#.###.#.## +#...####.. +#.#......# +#.#.##.#.# +#..#..#... +.#..#....# + +Tile 3877: +..#.#.#.## +..##...#.. +#..#...#.. +#.......#. +#.......#. +#...#.##.. +.#.......# +....#..### +##.......# +.#.##.#.#. + +Tile 2081: +####.##### +....#..##. +........## +....#..##. +#..#....#. +.##...##.. +......#... +.#....#..# +#.#.#...## +.##...##.# + +Tile 2789: +.#.##..#.# +.......#.. +##.......# +..#..#..## +..#....... +.#........ +#..##.#.#. +###.#..### +##..#...## +..#..#.... + +Tile 3989: +##.##...## +#....#..#. +.#....#.## +#......#.# +#.#..#.... +#....#.#.# +...#...#.. +#........# +.......#.# +##.##.##.. + +Tile 1933: +.....###.# +#...#.#..# +.#....#..# +.#........ +#####.##.. +#..#.#...# +#..#.#...# +....##.... +#....#..#. +##..#..##. + +Tile 1601: +##.#..##.. +.#.###.#.# +..#.###..# +##.#.#.... +.....###.# +##.##.#### +#.#...#..# +#...##.... +...#...... +.####..### + +Tile 1117: +#..##..##. +......##.# +....##.#.. +#....#.... +.#.#.....# +.....#.##. +#....##... +#.....#... +..#..##.#. +.#.###.#.. + +Tile 1409: +#...###... +#......#.. +........#. +.#........ +##....#... +#.......## +#......#.. +......##.# +#..###.#.. +.####.##.. + +Tile 3359: +##.##....# +#..#...#.# +#....##### +...##..#.. +..#..#...# +........## +...#...#.# +.........# +...#.#.#.# +##.#....## + +Tile 2539: +...##.##.# +#.##.#...# +...##.#... +..#.#..#.. +#.#..#.### +......##.# +#.......#. +.#.......# +#...####.. +..#...###. + +Tile 1607: +##..###.#. +#...#....# +#.#.#..#.. +#..#....## +#.#......# +....##.... +#..###...# +..#.##..## +##....##.# +...##..### + +Tile 2971: +#....#..## +.##......# +#..##..... +#...##.##. +#...#.##.. +....##...# +..#.###... +##.#.#..## +#..#..###. +#...###.## + +Tile 2447: +#..#..##.# +#....##..# +.....##... +..#.###..# +#..#.##... +#.#.#...## +#.#..###.# +####..#... +#.#...###. +#..###..## + +Tile 1709: +.....#..## +##....#... +.........# +...###..#. +###......# +..#..#...# +#.###.#..# +###....##. +...#..##.# +##.#...#.. + +Tile 3109: +.#..###.## +....#.#.## +..#...#..# +#...#..... +####.#.... +.#.#...### +###....#.. +#..###.... +.......... +##.##...## + +Tile 2089: +..####..#. +.###.....# +....#..### +.#.......# +..##.....# +#.###....# +#.#.##.#.# +#.......#. +...#.##.#. +...#..#.## + +Tile 1619: +#...#.#.#. +#......... +#....##.## +##....#... +#####..... +##.#..#..# +###...#..# +...#...... +##..#....# +.##.##...# + +Tile 3319: +###.#.#.#. +.#....#..# +#.#.#...## +...#.....# +.......... +........#. +.......... +...#.##..# +#.#.#....# +##......#. + +Tile 1621: +#.###.###. +.#...#...# +#.#......# +#....#.... +#..#.....# +##..#..#.. +.###..#.#. +#.#.#.#### +#.......## +##.##...#. + +Tile 2857: +##.#.#.#.. +...#...##. +#......#.. +......#... +.#.#..#... +.##..#...# +..###....# +#.##...... +#.###...## +..#..##.#. + +Tile 2143: +#.#....... +#...#.##.. +#..#.....# +...#.....# +#...#....# +........## +##....#.## +##..##..#. +#..#.....# +#..##....# + +Tile 3037: +........## +#....#..#. +......#... +....#.#... +...###.### +...###...# +.......... +#.....#..# +##..#..... +#....#.... + +Tile 1733: +#.#..#.#.. +.#....##.. +#..#.#...# +........#. +.........# +##....#... +#.....#..# +#..####.#. +#...##.... +..#....##. + +Tile 2657: +.##...#..# +#...#.##.. +##........ +.##......# +.#...#...# +..##...#.. +.........# +....#...#. +..#.##...# +#..######. + +Tile 1451: +#.....#..# +.....#.##. +......##.. +..#....... +.......... +#..##....# +###......# +##.#.....# +#...##.### +###.#..... + +Tile 3191: +####.#.#.# +.........# +###.#####. +#.....##.. +...#....#. +##..#....# +.#..#.#..# +#........# +######..#. +.####.#### + +Tile 3163: +.#.##.#..# +##.##.#.#. +##..#....# +.#....#.#. +##.#.....# +.#........ +#.#......# +#.......## +#........# +###...###. + +Tile 3067: +.#...##... +..###..... +##.#..#..# +##.##..#.. +.......#.. +#...##.#.. +####....#. +#.#....#.. +........#. +.##.#....# + +Tile 3203: +##...#.#.# +.##..##### +#.......## +.#....#... +.#....#..# +..#.#....# +#....#.#.. +#....##### +#...####.. +....##.### + +Tile 3229: +...#...... +#...#..... +..##.#.##. +#.#...#... +#.##.#..## +##....##.. +..#.###..# +.....#...# +...#.....# +..#.#..... + +Tile 2083: +....#.###. +.......... +.........# +...##..#.# +.##..#.... +#..#..#... +......#.#. +#........# +#.##...... +###..#.### + +Tile 3253: +.##..#.#.. +.#.#...#.# +#.#....#.. +...#.....# +#......... +#......... +.##......# +......###. +#......... +.....#...# + +Tile 1381: +###...##.# +#.#####.#. +###..#..## +#......... +..#..#...# +..#.#...## +.#.#.....# +..#...##.# +##.#..#..# +######.... + +Tile 2113: +.....##..# +.....###.. +...#.....# +##.#..#... +....#..... +...#...... +#..###.#.# +.......... +#.#....... +..#..#.#.. + +Tile 1087: +###..#.##. +#....#.... +..#......# +###.#....# +.#.......# +..#....##. +#...#....# +....#...## +....#.#.#. +#.#..#.### + +Tile 2833: +.....#...# +#...#.#.#. +#.......#. +#......#.# +.#.##.#... +........## +....#.#.## +........## +......#.#. +######.#.. + +Tile 1063: +.....###.# +#####.#..# +..###....# +...#.##... +###....#.# +.....##... +####.....# +..##.#.... +#...#...#. +...##.###. + +Tile 3049: +#.#.#..### +...##....# +#..#..#.#. +##.##..#.. +###.....## +#.#..#.#.. +#..##....# +#.#...#..# +##..#..#.# +....#####. + +Tile 1657: +#..####... +........## +.........# +#...#.#... +#.#......# +.#.#....#. +#....###.# +#..####.#. +#..#..#### +...###..#. + +Tile 3863: +##.####### +..#.#.#... +#....#..#. +........## +#.##...... +....#..... +#.#..##... +#.#......# +..#..#.#.. +##.####..# + +Tile 3083: +##.#...### +.#..#..#.. +#.#####... +#..#.#.... +##.....#.. +#..##..### +.#.#.....# +#.#..#..## +.#.#..#.## +...#...... + +Tile 3853: +#.###..### +##..#..##. +.....##.## +......#..# +...#.#..#. +###....#.. +##.....#.. +##........ +...#..#..# +###.###..# + +Tile 2129: +..#....#.# +#...#..... +##...##..# +#.#....... +....#..... +##......## +#..#...... +#..#..#... +.......... +...#.#.#.. + +Tile 1759: +..##..###. +.......#.. +.#.#.....# +.....#.... +#......#.# +#.#......# +#..#.#.#.# +#..#.#...# +#.#...#..# +.##....#.# + +Tile 3617: +..#.#..### +..###....# +##.#.....# +#.##....## +.....#..#. +.........# +.......... +.####..#.# +#.#...#.#. +....##.##. + +Tile 2017: +..#.##.#.# +....#...## +.......... +.#........ +#.....#... +#.....#... +#......... +....#.#.#. +..#....... +..#...#.## + +Tile 1277: +..##...#.# +.##..#..#. +.#....##.# +#....##... +#..#.##..# +###..##..# +.........# +.##.#..... +..#....... +##.###.#.. + +Tile 2617: +###....... +......#... +##.##..#.. +#.#....#.. +.###....## +..###..#.# +##...##..# +#..#...... +#..#..#### +#.##..#... + +Tile 2719: +..#.#.##.# +........## +...#.#.... +...##....# +.#.##.#... +..#.##.### +##.#.....# +.........# +..#.#...## +###.#..### + +Tile 3671: +#..##..### +#...#...## +.......... +...##..... +.#..#.#..# +#.#..#.... +#..###.### +..##..#### +#......... +.#..#.#..# + +Tile 3389: +.#....#.## +.#..##.#.# +#...##.... +##....#..# +##......## +.#...#.... +..#....#.. +....##.... +#.#...#.#. +#.#.#..### + +Tile 3457: +.######### +#..#...... +..##...... +#......... +.#...#.... +.###.....# +.......#.# +.........# +###....#.. +#.......## + +Tile 1777: +###.#.#### +#..#...### +.#.#..#..# +.......#.. +#.#..##.## +..###..... +###......# +.#........ +#.####.... +##..###### + +Tile 3613: +####.#...# +##.......# +.......##. +#....#...# +......##.# +...#.#..## +#......#.. +...#...#.. +.##..##... +.#...#..#. + +Tile 3529: +.#.##.#... +##.....#.# +#...#..#.. +......##.# +##..#.##.# +##........ +#.....#... +...#...#.. +...##.#... +..###..... + +Tile 1153: +##.##.##.. +..#####..# +##...#..#. +.......### +.#.......# +..#.#..... +.......#.# +#...#..### +.....#.#.. +.#.##....# + +Tile 2467: +####....## +#..###...# +#####....# +.#......#. +###....... +##.......# +.##.#.#..# +....#.#... +#........# +.#..#.#### + +Tile 3947: +#.##.##.#. +##.......# +......#..# +#...#..### +.....#.### +##..#..#.. +...#.#...# +#...#....# +.......#.# +#...#..#.# + +Tile 1399: +.##.#..### +#.......#. +#.......#. +.....#..#. +#........# +##..#..#.# +.##..##..# +#..#...... +#.....#..# +#.##..##.. + +Tile 2879: +....###..# +..#....... +#...#..... +...#.#.... +.........# +.##..#.##. +.#...###.# +.#.....#.# +..##.....# +##...#.#.. + +Tile 1039: +#......#.# +##.##.###. +.....##..# +#........# +..#....... +#......... +.#..#.#.#. +.....###.. +#....##### +.#.....### + +Tile 2777: +#..##...#. +....#....# +........#. +##.#....#. +..#.##...# +.#....#.#. +#....#.... +#..#.#...# +#...##.#.# +#.......#. + +Tile 1097: +##...###.. +..#..####. +##....#.## +#.....##.. +...#....## +.##..#.... +#.##..###. +##...#.... +#.###....# +.#.#.###.. + +Tile 3793: +####.....# +.......... +.#.##.#... +....#....# +#.....#... +..###..##. +##..#.#... +##........ +#........# +.###...... + +Tile 2689: +####...#.. +..##....## +#.#....#.# +.....##..# +#.......## +#......... +#.....#..# +##........ +.......#.# +#.###..#.# \ No newline at end of file diff --git a/2020/20/part1.js b/2020/20/part1.js new file mode 100644 index 0000000..9d5076a --- /dev/null +++ b/2020/20/part1.js @@ -0,0 +1,43 @@ +const fs = require('fs'); +const input = fs.readFileSync('./input.txt', 'utf-8'); + +const inputTiles = input.split('\n\n'); + +// it is implied that the image is a square, which makes it far simpler. +const sideLength = Math.sqrt(inputTiles.length); +const tileSize = 9 +let allBorders = new Map(); +console.log(sideLength); +let tiles = []; +inputTiles.forEach(inputTile => { + tileLines = inputTile.split('\n'); + let tileID = tileLines[0].slice(5, 9); + let tileData = tileLines.slice(1) + let borders = [ + tileData[0], + tileData[tileSize], + tileData.reduce((a,b)=>a+b[0], ''), + tileData.reduce((a,b)=>a+b[tileSize], '') + ]; + borders.forEach(border=>{ + if (!allBorders.has(border)) { + allBorders.set(border, 1) + } else { + allBorders.set(border, allBorders.get(border) + 1) + } + }) + tiles.push({tileID, borders}) +}) + +function reverseString(str) { + return (str === '') ? '' : reverseString(str.substr(1)) + str.charAt(0); +} + +let runningTotal = 1; +tiles.forEach(tile => { + if (tile.borders.reduce((a, border) => a + allBorders.get(border) + (allBorders.get(reverseString(border))||0), -4) == 2) { + console.log(tile.tileID) + runningTotal *= tile.tileID + } +}) +console.log(runningTotal) \ No newline at end of file diff --git a/2020/20/test.txt b/2020/20/test.txt new file mode 100644 index 0000000..b3aed46 --- /dev/null +++ b/2020/20/test.txt @@ -0,0 +1,107 @@ +Tile 2311: +..##.#..#. +##..#..... +#...##..#. +####.#...# +##.##.###. +##...#.### +.#.#.#..## +..#....#.. +###...#.#. +..###..### + +Tile 1951: +#.##...##. +#.####...# +.....#..## +#...###### +.##.#....# +.###.##### +###.##.##. +.###....#. +..#.#..#.# +#...##.#.. + +Tile 1171: +####...##. +#..##.#..# +##.#..#.#. +.###.####. +..###.#### +.##....##. +.#...####. +#.##.####. +####..#... +.....##... + +Tile 1427: +###.##.#.. +.#..#.##.. +.#.##.#..# +#.#.#.##.# +....#...## +...##..##. +...#.##### +.#.####.#. +..#..###.# +..##.#..#. + +Tile 1489: +##.#.#.... +..##...#.. +.##..##... +..#...#... +#####...#. +#..#.#.#.# +...#.#.#.. +##.#...##. +..##.##.## +###.##.#.. + +Tile 2473: +#....####. +#..#.##... +#.##..#... +######.#.# +.#...#.#.# +.######### +.###.#..#. +########.# +##...##.#. +..###.#.#. + +Tile 2971: +..#.#....# +#...###... +#.#.###... +##.##..#.. +.#####..## +.#..####.# +#..#.#..#. +..####.### +..#.#.###. +...#.#.#.# + +Tile 2729: +...#.#.#.# +####.#.... +..#.#..... +....#..#.# +.##..##.#. +.#.####... +####.#.#.. +##.####... +##..#.##.. +#.##...##. + +Tile 3079: +#.#.#####. +.#..###### +..#....... +######.... +####.#..#. +.#...#.##. +#.#####.## +..#.###... +..#....... +..#.###... \ No newline at end of file diff --git a/README.md b/README.md index 618a0c7..850613c 100644 --- a/README.md +++ b/README.md @@ -60,3 +60,4 @@ if (advent) { 17. [:star: :star:](https://adventofcode.com/2020/day/17 "see puzzle") 18. [:star: :star:](https://adventofcode.com/2020/day/18 "see puzzle") 19. [:star:](https://adventofcode.com/2020/day/19 "see puzzle") +20. [:star:](https://adventofcode.com/2020/day/20 "see puzzle")