diff options
author | Marvin Borner | 2020-12-24 12:56:31 +0100 |
---|---|---|
committer | Marvin Borner | 2020-12-24 12:56:31 +0100 |
commit | 8b5e64e52288bcdd71d2c5e630e99dd0e675089b (patch) | |
tree | b168e4f20298a8c5408c8db8eaf5ada45932e4b2 /2020/24 | |
parent | a98af220d1b4b31a540caa9d5b88dd6cd5303717 (diff) |
Not so much golfing today
Diffstat (limited to '2020/24')
-rw-r--r-- | 2020/24/Makefile | 2 | ||||
-rw-r--r-- | 2020/24/input | 547 | ||||
-rw-r--r-- | 2020/24/solve.js | 15 |
3 files changed, 564 insertions, 0 deletions
diff --git a/2020/24/Makefile b/2020/24/Makefile new file mode 100644 index 0000000..dad052e --- /dev/null +++ b/2020/24/Makefile @@ -0,0 +1,2 @@ +run: + @node solve.js diff --git a/2020/24/input b/2020/24/input new file mode 100644 index 0000000..44a2f19 --- /dev/null +++ b/2020/24/input @@ -0,0 +1,547 @@ +neeneneneswneneee +eeeswneseseeseeeseeeeesesee +swswsweswwswswswnw +neseewwswwneswnewnewwswswwswwse +wswsweenweesenweeeeeenweeee +neswwwswwwnewwwwwwwwsewwswsww +neseeeswesweenweeeeeeeeee +neeeneneeneeswneeneneneene +ewwsenwwenwnwswnwswwnewwwsewne +sesesesesesewseseweeeeneweseeww +neeeswnwneswneneneweeneeneswnwnesw +neseswnwnenenewneneesenenenenenenenenenene +eneeeeseseeseesewseseseeeseee +enenewseeenewnweseewnwneseweesw +sesesesesenwseseseseseseseswseseee +nenenenenwneeesweseneeeeeenenenwe +neeenenwseswsenewseswenwewsww +neeenesweswwneeneeeeeeeeenwe +swseneswewwsewsweeeseeswwsesww +nenwwnwnwswwnwwnwnwnwnwnweswswnenww +swswseseswnwswswswseswseeswswswswnwswsesenw +nwnewwswnwesewnwwwsenwwnewewe +newwsewwsenwswwswswswswseswwnwwwsw +swswsweswseswswwswswnwseswswswswswswswsw +nenwnwnwnenwnwnwnenenwnenwneswnesenwenw +nwswnwwnwnwwnwnenwwse +neesweeeesewewneese +nwneweswwwswswwswwswswsewsw +wwwwsenwwnwneswsewsewnenewnwwseswne +eeeeeneneneneweneeeeeweswnene +enenwneneeneswnewnweewseswneswnew +swsesesesesenweswseseseswswseswswsesese +nweeeneweewsw +nwswswneswswswneswsewswswswswsesw +swenwwnenwnwnwswnwsesenenw +swswswnwneswswswseswswswswswswswseswse +sweseseseeseseweenese +wnwnwnwnwnenwnwswnwnwenwsenwenwnwnene +eeenweeeeeeeeeeesweeee +nesenwswnwseswneewnenwenwsenwenwewnw +eeeeeewesenweeseeeeswe +swwwswneswsewwswsw +nwnenwnenwnenwnenesenenwnwnwnwnwnwwnw +newnesewnwnenwneneenwnenenwnenenenenesw +eeeeeeeeeeenweeeseeeesw +swnwnwwnwwwnwwewnwwsewwwwnwnew +nwnwnwenenwswnwnwnwnwwnwnenwswewnwnw +swseenwnwswnwnenesenenwnwneeswneenwwnw +enwwseeswwenwswswesw +enwseseeeeeeenweeeseeseswseee +eseswseseswseneenwwneeswwwse +swswswwesenwswswswswswswswswswsenesesw +neswenwswswswnwnwsweswnweswswsweswsw +newsenenwswesewenesewwseeesenwesew +seswswswswswswneseseswweswseswsewseswnw +wnwwwwnwnwnwwnenwwewnwnwswnwnww +newwwwwwsenwwwewwwnwwwww +seseseeeswseseswseswswwsewseseswswse +eenenwswnenwneswnesenwnenenenwnwnenenewsw +swnwewswwewnwnwswwwnwnwewwwse +nwenewneneneewnene +wwwwwswwswenwwsewwwwwwswsww +enenewswnwneneneneseneneneeneneeneene +wnwswswnewwwswnewwwsewwseswnew +nenenwwsenweswnwswswnwswnwnenwnwne +seeenwesesesewseseeseseeesesesese +eeneeeeeeeneenwenweswsweeene +wneneneswseneneneneneneeneenenwsenwnene +seseseswsenewesesesenwneseseeseseesese +wsesenesenwsesweseswnwsesweseseesenwsese +wwwwnwwnewewwswsenwseseewnwnenwnw +wnenenenenenenenenwnenenwnenenesenenene +neeewnwwneneesweneeweseswnwneswsw +neesewwneenwnwwwwseswwnwwwwswww +esweeeeeeneneenwe +eseeseeeeenwswseeseneeseseseswee +neneenewnweneseswnenenwneneenwwseswne +senwwnesenwswnwneeewswnenwnwwnwnwsene +eeeeseeeeeneewwneeweneeenene +nwnenesenwwwseswseswnwwesesenwwnene +swseneswswswswswsewswnwneseswseneeswsesw +nwnwwnwswnwnwwnwnwenenwswwnwnwnwnwenw +seswswseeesesenwnweeseeeneeenewese +nwsenenesenwwnenenwnwneswnenenenenenene +swsewnwwwseswwwsewneneswneenene +nwenenwnwnenwsenwnenwnwswnwnenenenwnenwnw +swwneneneneneenweeeneenesweenesenesw +swnwnwswnwwwswsenewsewswsewswswseswsww +enenenenesenenenenenenenenenenwswnenewne +newewesesewseseseseeeseseeesesese +nenwwwnwsewswwwwewsewwwwwsew +enwewnwwwwnwwnwnwnwnwnwnwwwnwnwswnw +neweeswesweeswewneseewnw +swswswswsewesewswswswswneseswswswseswse +swneeewseneeeeeswneewwneseenwe +wwwwwwwwwneewwsewwwwweww +eeeesweneenweeeneneeweeenee +wnenwneseeenwseeneneewneseswwnene +wwwnwewnwnwnwnwnwewneenwnwnwswswswnw +enenenenwesesewnwneeeswneneeneenenene +nwnewseneseenwwwseswneswseneeeswnew +swsewwsweseswneseseeseswneseneswswse +swswswwswswnewsesesweswswswswseneswnesww +enwwnwwnwwnewnwswswseeswnenwwnwwnwse +sesenwnenwnwnenwnwnwswnwnenwnwnenenwnwnwsw +seeneswswwswwswswwwwswwwswnenesw +swwwwswneseswwwwswwnwswswswswwswsew +swseeenenwnwswenwneneenwnwnenwnwsewsw +wswswswwwswwwswswswneswswswseswswsw +neswnewnenenwnenewenenwneneeenenenw +eswneneneneneenenwneneeeneenenewe +enenenenenenwneneeneeeeeeenese +seeseewswwseseneesenwneseseswsewswsw +ewwewswwswwswswwewwnwswwsww +swwswswswswswswswswswne +nwnenwnenenenwnwnwswnwne +nwnenwnwswnwwewnwnwswnwsenwwnwnwnwnw +nwnwnenwnwnwnwwnwnwnwswnwswnwnwewnwnw +eseneseeswenwneeneneneneewnenwnenene +swwnwwswwswswwswwswswswsewwwwswne +swsewsenenweseesweee +nwnwnwnwsenwnwnwnenenwnewnwnwnenwnwnwnw +nwsweeeseseeeeseeeeseneeswene +neenwneneswnwnesewewswneswnwnwneneswe +esenenwnwnewseneswnwsewswwnwsenwsewswse +nwwwweneeewwwesesenwneneswswswnw +nwnwsenwnewseswnwesenewnenenwnenenenwe +wnwwnwnenwnwsenwnewwnwwsewwnwwwwe +wwwewwswwswwwswwwwswsw +swswwswswseswswswswseswswswswnesw +wwwwwwwwwwswwewwnwwwww +nwnenwnwnwnwnwsenenwnwnwnwnwnw +swnwswswswswwseeeswswswswswswsewnwnwsw +nenwnenwnenewnwnenwnwnenwnwseenenwnenwne +seewseeseeeeseseeeweneseseseese +seenesesesesesesesewseseseseesesesese +nenenenenwneneneenweneneneesenenenesene +swswneneeseswwswnwseswswwswswseswsesw +nwswsenwneenwnwnwnwsenwnwwsenwenewnwsw +nweseseseswswswswswswswswswsw +seseswseseseswsenwseseseseesesesesesese +wwwwwwsenwwnewewnwwsewswnesww +nwseswswnwseswswsewseseeseswswesesesesw +seswseseenwswseseseenwswseswseesewswse +nwwnwnwswnwwnwnwnwnwesenwnwnwwwwnww +neneswseneneneswwnenweneeneneenesenww +swswswswneseswswseswswswwswswsesweswswse +swneswseswswswswswswswswswseswswseseswsene +swswneneswswwneswwwswswswwswnweswsene +nenwnwnwwnwnwnwnwnwnwnwnwnwenwnwnwswnwnw +wwneswwwwwwwwewwwnwwwsewww +neneeswnwneneeneeee +swesweswswnesweswsesewwnenwnwnewnwnee +nwwwwewwwwwwwnwwseswwwswwe +sweenwseeseneweseseeewnwseeseenenw +eeeeeenweseeneeeeeeeenesw +nwnwnwswnwnwnwswnwnwnwnweeenwnwswnenw +eneeneeeeweeeeeneeeeneewsee +swnenwnweneneenwnwnwnwswnwnenenenwnwnwnw +nenwnenwnwnenwnenesenenwnwnwnenw +neeswnweswswseewwnwwweswwwwwne +nwseeeeeeweseeeeseeeeeeee +sweseneneseeseeseeneeeeeewsweew +wnwwnewswwwswwwwewwwwnwww +wswnwsweswwneseswnwswswwseswsweswnwwsw +nweswneeweeeeswsenwew +neeswneneenenweeneneneeneseenesenwe +nwnwnwnwnwnwnwnwnwnwnenenwnwnwnwsenwnwse +seswseseswseseswseseseseswsesenw +nwnenwewnesenwnwnwnwnewnenwnenwne +swswswswesweswswswwswswswswswswwswsw +nwnweeeeeeeeeseeeeeeeese +wswnwnwswswswwwwswswswswswwwseswswse +seneswwseswsesewsenwsenenesenwseseese +neneneswneswenenweeneenenenenwnwswnene +newwwnwwwwnwsewwwwseswwwwse +swsenwenwnwnwnwnewnwswenwwesw +newwnwnwnewsewwswwwwnwnwnwswww +eseswsenenesesenwwseswseseseeseesese +nwwenwenwsenwnewnenenwnwwnweneswnwne +neswneneseswseeseseswswsenesenwswswsww +neneeeswseneswnwnwwenenenwseswwwe +nwswseseseeeseseseseesesesesese +wswwnwswswnenwneswnweswseenwewwwse +swseseswseneswswseswswseseswswnwswseswswsw +sesesenwseswseseseseseeesesesesesesese +nenenenenenenewwneeeneneseneeneneene +wnwswwewswnwnwsenenwesesweeswsene +enenenwneneneeneeeneeseswneenenenene +seenwseseeneeswwneseeeseswwesenww +seseswnwwsewnewswnwseswneswswswesweenw +nenenenenwnwnenenwwnwenwnenw +nwwwwnwneeeeneneneseswsenewesenw +swswswneneseswwwwswswswswswnwswswswsw +nesesenwswswseswnenwsewswseseseseswnese +neeeenenweswenweneneeneeneeeeese +seeweneseeneseseseswseewsenenwe +seseseseseseseseseseseseseseswsenwsw +wswswswswsweswwwwseweswwwswswne +nwseeswneswneswwnenwseswenewseswwsw +neeweenweeeeneeeeeesweeeee +swwswwswwneweswwswswwwswsewwsw +sesweswwswenwweswswesenwnwnwnweswse +nwneenenwnewenesw +wnwseewwenwwwwesewwwnwewwnw +eeeneesenenenweswene +seenwseseseeseseewsweesesesewsese +wswsweswswseseseseseseseseswswsesesenwse +wweeeeeneeseeeeeeeeesese +swseswseseseeswsenenwseswseseseseseswsw +wwwewwwwwnwswwwnwnwnwwwewnw +wwnwnenwseneeswswswewewswswswwenw +neswswswswswseseswseseseseswseesenwswsw +neeswnewnwwswsenwnwnenwnwsenesewene +nenwseeswwswseswsesesweseswswswswseswsw +nwwwwseneneswseseneeseswswnwnwseene +seesesesesenwseweseeseseeseseswseese +ewwwswswwsewnwwwwswnewneeswsw +eeneneneneneneeneenenewnenenenesewne +enweeswnwsweseneeneenwsenewnwswswne +sesenwseewsesenweseeeseseeeseeenee +nwnwnwnenwnwnwswnwnwnwnenwnwenwnenwswnwnwnw +seswnwsenwnenwnwnenwnenwnwnenw +nenwnwnwsenwnwnwnwnwnwnwnesenwswnwnwnwnwne +swnwnenwnenenwnwnwnwnenwweenwwenwnwnwnw +senwnwnwwnwwwwnwwnwnwnwswnenwnwnwnewnw +neswnenwswsesewnwnewsewwnewnesenewnwnw +wwwsenwnewwwwewwnwwwwwsww +enwneeneneswswnesw +enweesesewsenesesw +eeswewneesenenweneneneneneeseee +nwnwseneswnwnwwewwwwsenwwwnwww +swwneswneswwwswsweeswswswwswswseswnw +ewwwwwsewswwwwwwenwwwneww +swneswseeswswswwswnwsewwswswswswwswwsw +sweswwswseneseeewswwnenwnwneewwsw +swwswswseswswswwswswswswswswswwswswne +nwwwswwwwwwswwweweswneswwew +neneneswsenenenwnenenwneswnweweenwsww +senwswnewwseseeseenewseseneeeswene +nenwsewwsenewswseenesewsenenewnwe +swswswswwwwwewswwnewwswwwwww +swsweswsenwnweenenwe +wnwsesesesewseswnesenesenwswsesesesesesese +eeewseeeseeweeeseeewwenee +eeeeeneeeeeeeweseeewwe +neneneneenenwneneneneneneneneneneneswne +seeseeseesesesenweseeeswneenwnwee +seeeseenwswneeeewswewneseeew +nwseenwnwnwnwnwswnwnewwseenwnwnwsenw +esweeeweweneeseeneseee +ewswnwswswwnewswwsweseswweswswww +sweseeneswwwwnwnenwsenwwsweseswe +eweeseseeswnwneneeeneew +swnweseeeeeneweeeeeeweene +wwnwwweswwnenwwnwnwswwwewwsw +neneeeweenewneneeeeneeeneswe +swwwesewnwsenenwnewnwneseenwwswnew +senwnwnenwnwnewnwneneswwneeneneenewse +nwwwnwwwwwnwwwwnwsewnwwwsew +wwwswwswwwswwwwseneneeswwwww +neswswseswswnwseswseseswswwseswsesesesese +nwsewnwnwwnewnwnwnenwneenwnwseneenw +seseseseseseseesenewsesesesenesewsese +newwnwnwnwwnwwwnwsenwnwnwwwsenww +swswenwnewswswswneweweswswswswnwsesese +seeseswseseseseesesesesesewseseswnwse +nenewneneneswnenwsenenenenewneenenenee +sewseneseswneseneseeewswnwswsewswwsw +eeswwswswswswswswswswswsenwswswnwwswsw +seneenwswseseeeneeeeeswswsenewe +nenenwnwnenwenenenwnewnwwsenenenwnwne +nenwenwswenwnenwnwsenwwnwenwnwswnwnw +wwwsenwwswnwwwewenewwwwwnwnw +nwnwnwnesenwnwnwsenwnwnwswnwnwnwnwnwnwnw +swswswswseswsweswswnwswwswseswneswswswwsw +eswnenwneenwewnwnwnww +seseseseeseneseseseseseseweeseseseswnw +enwwnwnwswnwnwnwnwwwnwnwnwwnw +swsewseneswneewwwwnwnwnwnwwseswsesww +nenesenwnenenenenenenenenenewneneswnee +nwweswwsweswswswneswswnwswswswswww +neeneeneneneeneenenenenenenewsenene +nwswswswsweswwswswswwswewwwswswsw +swwswwwwwswwseswswswnwweneswswsw +wswnwneeneswnwwswwnwwsenenewwnwww +nenenenenwwenwnwnenwenenww +seseneseseswwneseeseewseseesesenwse +nwenwsenwnewneswnwnenwnwnwneenwnwnwnenw +nwnwnenwnwnwnwnweswnenwsenenwnwnwnenwnwwne +nwnenwenwswnwenwwswnenwnenwnwnwnwewnee +wwnwenwnwwnwwwnenwnwwnwnwnwesww +neseeneeeneeeeewneneneneeenee +swseseswnwneeseseneswswwswswnwswse +swnwswseswswwswswswneswsw +swwweeeeswnwneneeewnweeeeee +enenwnenwsenwswnwnwnenenwnewnesenwnwsenwnw +swewswwneneseeeenwneenenwnenwseee +seseseseseenwseneseseeseswseeseswnwse +seneeeseseeeseswnwswsesesenwwwseenw +wwnewwwwwwwsenewwwwwwswwnww +nwswwwswswwnwsweswswsweswswsesweswsw +swswnwnwnwnwwenwnwnwenenwnenw +seeseseseseweseseeeseseesee +wnwnwnwsewnwnwnwnw +nwnenenwnwneswnwnwnwnwnwnwnwneenwnwwnw +sweeseneweseneswenwsesenweswsenwnee +wswnwnweseseewenenenwenenesweene +nwnesenwnwseesewneswwnesweswnwnwsenww +sewneswwwnwewnenwnwnwwwswnwwnwswe +eeesweseneeweenweeswenweneewe +neneneeneeeeneneeesweeenwenene +eeneneeeneeeenwneeswweneenenee +sesweeneeseeeweeeenweeeese +swnwswneewwwnwwsewwnwnwwnwnwwenwnw +eeeeesweseeeseswenwnwenwnwee +sewwnewwswwwwswnesewswsw +nesewseewseswsesewwswweseseneswswe +newneenwsewnenenenenenwne +sewsenwseeseesewneswwwnwsenweswnene +swswswwwwwswwwswneww +wnewwwwwwwwwwwwwwwswsw +swwwnewwwwswsenwnwwwnenwseenww +neeenenwweneeneeneneneneneeneneswse +nwsenwnwnwnwnwswwnenenwsewnwswnwenwse +nwesenwnewwnwwwnwwwwnwwswnwnww +neswwsenwswnwwwswswseswswwsw +neneeneswneneneenewnewseenenenenene +seswseswsesesenesesesesesese +wwwnwwwwweswewswnw +seneseswsesewseseneesewwseswwswsenese +enenwnwnwwnwswnwnwnwswnwenwnwswenwnw +neswwsenwswsweneswswnwswseswnesenwnesw +senwwnweswseswneswneewneseesesesesene +nwenwwnesenwnwwswenwnenwswnenwnenwse +weneeseeneeswweswnweswenwewswnw +eswnwewwnwnwswwswwswene +swwnwneseseseneneseswewswwsenewseee +seswwnwwwswseeswwswnwwsewwenene +neeneneneneneenenenenewsenenenwswnene +eesesweeeeeeeneenweeweseww +seswswswnwswswsweswswnwswswswseswswswsesw +nenwnwnwnenenwnwnwnwwnwsenesenwnenwnew +neneswneneneenesenwnenenwnenwwnewnesene +wnwnwewnwwswsenewenenwnwswwwwwwnw +weneswnenwnenwnenenenenwnenesewnwnene +eneneewswneenenwswnenweeeeneesee +neswseseswseswwseseseseswnwnwnwswnwsesw +nenenenenenwenenewnwnwwsenwnenenenene +weseswnewnenwwenwnwnwewnenenwsenw +swenwnewewwwnwneswewwsewnwsewnw +seseseseneswseseswseswseseseseswnesewsesese +nwnwnwnenwnwnwnwnenwnwenwnwnwnwnwnwnwsww +nwesweeeneeeeseeeeeneeeeee +esweseswnenwsenwnw +swneswwswswswewswwnwnewswsenenenwsw +enenwnwswnwnwnwsenenwnwnenenwnwnenwnwsenw +neswneswswswsenwseseneswseseneswseswswse +ewneneenwnenwneneswnwnw +swsenwsenesweswwnwsenesewswswwseswswsesw +swwswwswwwswwswswwswnwswswswe +nwwnewwewwwwswneswwswswseswswsw +seeseswwnesesenwsenwswweseswenwnese +nwnenwneneswswwnenesenenwnenenwnwnenenene +nenwnenwnwswnwnenwnewneneneneneneneenwne +eeeenenenenwneneeeeeeneewsese +neseswsesesesewsenewsesenwseneswnesesw +eswnwswsweeswnwnwnwwswwwswwesesesw +wnwwsenwwwenwswswswsewwenewnwwnw +seweeeeeeeneeeeseenwswnenwee +nwsenwwwwwwwwwwwwnwwwneww +swneswswswswwswsweswwwswnenwwswseswsw +swneeeeeeesweenwneneeeeeee +neewsewswseswswsenwswswneswwswenesw +wnwnwsewwswnwwwwnwnwnwnenw +neseseeseswsesesewswsenwswseseswseswswnw +nwenenwnwnwnwnwnwnwwswnwnwnwnwnwsenwe +neneeewnewnweseenenwswwnesewsee +sesewseswneswswseseswnwswswneswneswswe +seseseswseswsesesesesesesesenesesewsesenwse +enwwwswswwwnwsesewwewwwnwew +nwsenwnweseswnwnenwnwnwnwnwnwwwswnwnw +nwseseeneseesweseseseseseseseeswnwsese +seswswseswneseswswneswswswseswswswswswswnw +swswsenwseswswseswswswseseneseseseswneswsw +seseeseswswswswswseswnwswswnwsweswsesw +wneseswseseneseesenenwwnesewseswswese +neneswnenwnenenenenwneesenwnenenenwnwnene +sweneseweseeeeeseeeeeenweeee +enwnwnwnwnwnewenwsenenenwnenenwnwswne +weeeeneeeseseeeeseseesewewee +wsenwnwsewwwwwwwnwwnwnewnwww +nwnwewnwnewnwsewnwwnwnwnwnwwwwwse +swswswwwwswwswswsewnewwwswwneww +nenwswewwswneswwswswwweswswwww +neneneswenenenwneneweewnwnenenenene +swswseneseseseseswseswsese +nwnesenwnenenewneseswwwnwenenwseene +wsesewseseseseseseesesesesesenesesese +seseweswsesesesesesesese +nwnwnwnenwsenwnwnwneswnenwnenwenwnenwnw +seseswewseneseseseseseseswswsesewnese +seswseswsesenesesesesesenwswseseseswsese +sweenwseeeeeeeeenweeeeeeswe +eenwwnewswsesewewswswseneswnewww +wwwwwwwwwnwwsewww +wnwnenwswenwnwnwnwse +swneseneneswneneesewwnenene +wwswewwwwwwwwnwwnwwwswwswwse +sesesewseeseswsewseswnesesesesesesene +swwwwwwwwwswwwwnewwwsenesw +swswseswswnwswswswseseeswsw +newwswsenwnewwsewseseswenwneeswwnw +nwsweswswswswswswnwswswswseswswswswsesw +nwswneseswseswsenewenewwneseewsenw +sewseneseneseseseseesewseseneswsesesese +wnwnwenwnwnwnwnwnwnwnwsenwnwneswnwnwne +sewneewwsesenwnwnewwswwwwneswwsw +wwwnwsewwwwswwwwwnwwwwwe +ewneenwseneneewswneswneenenwenee +swwswswswswswswneswswseswswweswswswswswsw +nwswnwswnenenwswneneneneeneene +esenenenwneneneswenenewneneneenenenenene +swswsweseewweswwsesw +enwewwnwnwsenwneseswwesewnewenew +eeeseseseeneesweeeeeee +ewenwwwswwseswnwswnwwswsweswwww +wnwweeneenewnenenwnewswneeesew +nenwnenwnenenwswnenwnewnwnenwenwnwnene +neneneseneeeneneesewneneeew +neneneneneneneenenwneneneneswneenesenene +nenwnenenwnwnwenenwnwneneneenewswnenenw +swwwswwwwewswswswwwswnwseneswswww +neenenewneneseneneesenewenenenenwnwnese +wnwwweswswswwswweswswwswwswwwwnw +wswwwewwswwswwwwwwnwwwsw +senwesewenwseseswesesesenwswnwsesee +nwnwnwnwnwneneswnwsenenwnenwsenenwnwnw +seewwwwwnwnwwwwnwneswwwnwswnww +seeweseeeseeeeseneeswseeseene +enesweeweeeneesweneseeeeneee +senwseweswneeesweeneseweeesenesew +swswseswseswswsweneswswswwenwwneswsw +swswswwewnwswswswswewwswswswswswswsw +swswswseswsesewseswseenwseswseswnwnesese +ewswswswswswneswswnwwenwsesenwswwsee +swnenwweesenwswnewneneneswnwnwnwswnenw +nwnwnwnwnenwswnenwnenwenwnwwnwnenenwnwne +neneseenewnenenenewnenenenesenenenenenee +nwnwnwswnenwnwenwsenenwnwnenwnwnenenwnwnene +nenenenenewnenewsenenenenesenenenenene +swswswswseseesesesenwswswsesenwseseseese +neneneweeeenesesewneweneeeneene +wwnwewswsewwnewwnewwwww +seseeeeseeeeeesewseee +senesesesweseswenwnesesweseneeseswe +wweeswswnwswwsesesewesenwseewee +nwwnwwnwnwnwnwwwnwnwswenwwnwnw +wwswnewwwwwwwwwwsewwwww +neneeneneneneneneeneenenesenenenewne +neweseeeeseeeeeeeswseeseesee +nweneneswnwnwnwnenesenesewnwnwneenwnwnw +neneseswnenenwnwswwnwnenwnewseneseneneenw +nenenewesewseweeeswswneswneseee +swswseseeseseeeseesesesenwsesesesenwsese +seneeneenweeneneenesweeewneee +wwwewsenewwswneeneeswseswswenw +nwnwwnewsenewswnesenwwwnwenwwsenwnw +seeenwneewnweswnweewseewseese +sewnwswwwwnewwnewnwwwsewwww +swsenwnwewnwnwnwnwnwnwwnwnw +enwesweeseeneswneeseewsewwnee +wnwweneswswwsenwwwnwwwwnwnwww +wwwswwwwwwnewswwwweswwww +swswnewswswsweswswwwswseswswwwsw +wwwnwwewnwwwwnwwwwnwwwnwsew +nwnwnwnwnwsenwwnwsewnwnwnwnwnwnenwnwnw +nesenweswnenenesenenenwneneeeneenwne +sweeeseeeeesenweseeseseeese +eseswwswseswseswneseseseseseswswseswwswsw +nwenwnwsenwnwnenwnwnwnwnwnwsenwnwnwwne +wewwwwwnewwwwewwnwwswww +wnwwwswswneeswswswswswseseseesenwesw +seweeeenweeeeesweeeeee +nenenenenwsewnenenwneneswnenenenenenenene +neesewneswneeeneneneneeenwwwneene +swseswneswseswwesesweswswswnwseswnwswswe +newnwwwseswswwswwswnwswwwsewswwne +swswswwswswswswswsenwseswnenewswwswsw +neeneenenewneeweeeswneseeeeee +newsewnenwnewsenesewnwee +nwnwswswseseneswswnweseswsenwneseweswsw +seswswwwwwswwneswswwenewswne +eneeenwwnwwwwwswnwnwswnwnwwww +nwnwnwnwnwnwnwwewnwsww +seeswneseseseeseesesesewenwseenwwse +nwnwwswnwwwwewnwnwwwnwnwwewnwew +eeseseseeeseneseeeseseeneseseswwsese +swwswswweswwwnwswneswwswswswwww +wnwswwwwwnwnwwwsenenwewswwwnenw +sewswseseswnwnwsweenweswwseswswswnenwne +wwnwwwnwnwwwwwnenwwnewswnwwnwwse +seweswwneeswsenwswnwwswswswnwseswwsw +nwnenenwnwnwneswnenenenenwenwnenwnenwneswne +sewsenwnenwnwwwnenwnewwsenwwnwwnwse +seseeseseenweneseweseswswswnesesenw +swwneswwwwswwnewwswwseswswwsww +seesweswnwseseseswnwnwswswnwse +eesesweseeeseeeeeeenwsweene +swseswswswseswswswswswswswwswswenwswsesw +swwswswsweswwwnwswswswnwswwsewswsw +nwnwwwnwwnwnwwnwwneenwwwwnwsesee +weeenwseseseseeseenesesee +nwnwwseenwwwwnwwnwwnwnenwsenwnww +eeeeseseeeeswseeseseswneseeseeenw +eeeeeneesweeeesweeenenweeee +eweeseneeseesesenesweeseewsewne +neneneswswenenwwnenewsweneswenwswsenw +wwswnwsewneseswswneesenewswwwsenwsw +seswswsweswnweswesweswswwnwnwsesese +weneeeneeeeewseeeeeeeneee +nwwnewwswwswswswwwswswwewswwwe +seseesewseneeseesesweswsenwwsenwsese +wenwseeswwnwewwneswnwenwwnwnwse +wwwewswwwwwwwewnwwwwwnww +seseswsesweweeesenweeseeeeseesenw +swseneswneseswwswswswswseneseswswswswsesww +esenwseseeeseseseesesesesenwwnwseene +neeneneneeneeenenenwwswe +wnewwswswswwwswswswswsewswwswwsw +eswnwesenesweeeneesweeneseeesw +nenwneneneeswneneneswnwnenene +swswswswswswswneseswswenwwnweswswswsw +eeeeneeeneeewneneeeeeeenwesw +neneeesweseneneenwseenwnee +nwnenenenwswewnwnwnwnwnwnweswseswnenw +wneseseseseseseswseneswseseswsesesesese +wswsweseseswswneswwswneswneswswnwswsw +swnwnweneneswsewnenwnw +nwnwnwnwnewnwnenwnenwnwnwnwnwnesenenesene +nenenenenenwnenenwneenwswnenwsenenenenw +swnwswnweesenwswswswsenwswseseeswswsesw +ewswnwseswsenweenwsenesesewsee +nwnewseewsewnwnwnesewwnwsesenwwswnw +nwnwnenwnenwneneneenwwnenenenwswnwenenw +nwwwswwwwwwnwwwswwenwnwwwe +wnwsenesenwswsewswneswswnwsewswwwwsw
\ No newline at end of file diff --git a/2020/24/solve.js b/2020/24/solve.js new file mode 100644 index 0000000..dca0e75 --- /dev/null +++ b/2020/24/solve.js @@ -0,0 +1,15 @@ +const { _, performance } = require("perf_hooks"); +const fs = require("fs"); +const I = fs.readFileSync("input", "utf8").split("\n"); + +M={e:[0,1,-1],w:[0,-1,1],se:[1,0,-1],nw:[-1,0,1],ne:[-1,1,0],sw:[1,-1,0]}; +N=t=>Object.values(M).map(m=>t.split(",").map(Number).map((c,i)=>c+m[i])).map((n)=>n.join(",")) +B=(t,b)=>N(t).filter(n=>b.has(n)) +W=(t,b)=>N(t).filter(n=>!b.has(n)) +n=b=>{w=new Set([...b].flatMap(t=>W(t, b)));o=new Set();for(t of b){r=B(t,b);if(r.length>0&&r.length<=2)o.add(t)}for(t of w){r=B(t,b);if(r.length==2)o.add(t)}return o} +s=_=>{D=I.map(t=>{D=[];for(i=0;i<t.length;i++){s=t.substring(i,i+2);if(t[i]=="e")D.push("e");else if(t[i]=="w")D.push("w");else if(s=="se"){D.push("se");i++}else if(s=="nw"){D.push("nw");i++}else if(s=="ne"){D.push("ne");i++}else if(s=="sw"){D.push("sw");i++}}return D});b=new Set();for(t of D){p=[0,0,0];for(d of t)for(i=0;i<3;i++)p[i]+=M[d][i];k=p.join(",");if(b.has(k))b.delete(k);else b.add(k)}console.log(b.size);for(i=0;i<100;i++)b=n(b);return b.size} + +const tic = performance.now(); +console.log(s()); +const toc = performance.now(); +console.log("TIME: " + ((toc - tic) / 1000).toFixed(6) + " seconds"); |