summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Silverstone <dsilvers@digital-scurf.org>2020-12-24 08:16:39 +0000
committerDaniel Silverstone <dsilvers@digital-scurf.org>2020-12-24 08:16:39 +0000
commit0f0596660a91f3fc0273bb5f3966431192426585 (patch)
treecc3ade653c36755d1786701d3fce4c3a46cf9737
parentf722aa7d711e56a03c4c1fd7478d4c9bc74e2970 (diff)
downloadaoc-0f0596660a91f3fc0273bb5f3966431192426585.tar.bz2
2020: Add day24
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
-rw-r--r--2020/inputs/day24564
-rw-r--r--2020/src/bin/2020day24.rs219
2 files changed, 783 insertions, 0 deletions
diff --git a/2020/inputs/day24 b/2020/inputs/day24
new file mode 100644
index 0000000..75dbff1
--- /dev/null
+++ b/2020/inputs/day24
@@ -0,0 +1,564 @@
+eeeseswneenwnwenwseeeee
+swswnwswswneswswneeswswswswseswsww
+sweswwnwseswnwewnwseewseeneneswww
+swnwsweseneenweeseswseseeswseenese
+nwsenwsewnesenenwnenwnwnewnwswwwswne
+ewseeeeeswnee
+nenwwwwwnwwwnewwwsewnwwswwww
+neneeenenwnenwnesweneneeswneneenee
+wnewsewwswnwswwsew
+seswseseswnwseseseeseseswswswswseswswswnwse
+swwweswweswseswseneseseseswseneswse
+weeswnwswnenwseenenweswnwwenwnwwsw
+seseeseneseeeeseseseewnwseeeesee
+seseswseswseswseseeseseswsesewneseswsese
+eseeeenenewneeneew
+neneswswswnwswenwesewswwswwswswwe
+nwnwnwnwnwnwneswnwnenenenwnw
+wseseseseweseseweeseenese
+wswwwswwwwnwswnwseswwnewwwswsew
+eswnweneeesweenweeenweeeswwe
+seseseseseseeseswseseseeseeseeneee
+swsenwseseeeseseeseneswsewseeseesese
+nwneswwnenwneneneneneneneenwsenenwneenenw
+swswswsweswswswswswswswswswswswswswwsw
+swswnwseswswswwswwwwswswsw
+wnewseswwswwwwswwenwwswswwwwwsw
+seseswsweseseswseswseswswseenwswsewswswsw
+seseneseswseswswseswswsesenwseneneswsew
+nwnwnenwnwnenenwsenwnwnwnenwnwenwnwnwnwsw
+sweeeeneeneeneneneeneneene
+nenenesweeneeeeneeneneneneenwnene
+swnwneneneswenenesewnenene
+neeneeenenenenenenesweneneeneee
+nweesesesesweseseseesesewsesesesesese
+seseseneseesesesenwswsesesesesesesesesese
+neseswseesesenwseswseneeseseseneseseswsw
+nwnwnwwwsenenenwseswnwnwnenwnenwnesenwsese
+neswsewswswswswswswswswwswswswswwwsww
+nwnwnwnwnwwnwnwswwnwwewnwwwwww
+nenwswneswnenenenwneneswnenenenwnesenwnenee
+sesesesesewseseswseseseseseseesesesese
+eeeneswesenwneseeeneneneneeewne
+neseswnesesenwseseswsesewseweseswese
+seseseneseswseseseswsesesesesewsesesesenw
+seswswnenwseseneseenwsesese
+neswwwnwsenenwwnewwnwsenewswnwww
+neneswneswnwswnwwswseswswswwswwswswesw
+nwnwneenwnwnwnwwwnwswnwnwenenwnenenw
+nwwwnwwnwnwseseenwnwwnwnwnwnwwsenw
+nwnwnwsenwnwnwnenwnwnwnwnwnwnenenwnenenw
+sweseswenwseewnweeeseenesenwsee
+nenenenenenenenenwneseneeneneneneswnenene
+wswswsweenweenwneswswnwnwnwneseew
+swswswnwswsweswwswswswswswseeswswswsww
+nwnwnwnwnwnwnwnenenenwnwnwnwwnwnwnwsene
+wewwswnwnwswwnwwnwwnenwwewnwnwnw
+nweeeeeeeeeeeswneseneeseew
+wwwwewwwnwwnwnwnwswnwwwww
+wwnwwwwwwwwwwwwwewseww
+nenwnenwnenewnwnenwnenenwnenwnenenenwnwse
+swswswswseseswnewwnwswswswwneswswnew
+ewwwwnwwwwwwwwwwwwswwww
+senesesewwswswnwwneeww
+wnwswnwewewswwseeswwwwenww
+weenenwwwsewneneneseeswneseesenesw
+seseswwneswswesewswswwsweswnwnwswnwne
+nenenenenenenenenenenenenenenenenwneswne
+nwnewnwnwnenwsenenwnenwnwsewnenwnenene
+nenwswenwnwwnwwnwneseenwnenwsenenesene
+nenwwwnwswnwwseenwnwwsewnwwwwnww
+wseswswswseseneswenewenwseseneswswwnw
+neneneneswenenenewnenenenwneneeneene
+nwnenwnwnenenenenenwnwnwneeneswnw
+newnenwnewseneneneeneneseneneneneew
+wnwnwwnenwnwswwnwwnwnwnwnwwnesewnww
+eneneneenenwwneneeneneneswnenenenenene
+sweenwnesenewswwswwswwsewwswnwswsenw
+swwswnwwswwseseswwswswnwswswswswnwswse
+swseneseeeeesewseesese
+swwswswswewsweneswswswseswswwnewseswsw
+sesesenwweneseneseswneswwwesesesee
+wnwnwnwnwswwwsenwnewnwwnwnwenwwwse
+nwnwwnwnwnwnwenwnwnwswnenwnwnwnwnwwse
+swseeseseeeeeeeeeenweeeesee
+neseneneeenewnenenwswwneseneeswneswnw
+neeneeeneneeseneeneewneweneeee
+seseswswswseseseswsenew
+eeeeseeeeseenweeesweseseenwe
+ewenwseswneneeenwseswwnwnwweswe
+swwnwnwwsewneswnenwewnwwnwsenwnesw
+nwnwnwnweneeneseesewwwswnwswnwneee
+swswwwwswswneswseweewwnwwwswwswsw
+neneneneneneneneneneneneneneneneneneswne
+swseswseswswseseseswswswseswsewsesenenwsw
+neswnwswseswswswseswwswwswwneswswswswsw
+weneneneneeeeenwneneewneeneeese
+nenenenwnwnenwneneneswnenwnwneenwnenwne
+sweseweneseswnwnwenesenenwnenwnwwnenene
+ewewsweswweswswswnesenwneswnwsew
+seseseseseseseseseseseseseneseseseseswsew
+nwnwswnwnwnwnenwnenwnwnwnenwnwenwnwnwnwnw
+nwnwsesenwnwnwnwnwnwneswnesewnwsenwnww
+neenenwnenenwwnwnenenenenwnwnenenwnene
+nenwneenwwneseneneswneseseneenewnenese
+sewnwswseswnenewwwwseweswwwnww
+enwnwneswnwnwnwnwnwnwnwnwnwnwnwwnwnwnwe
+neneeneneneewseneeneeneneneenenene
+swseseeswseswswswswswseswswswswswswsww
+nwseseenwswswwswsenenweswnewswnwswe
+wswwwwwwwwswnwswwswwswwwew
+eeeneeeenweeneneeenesene
+eenwnewswswwswswnwnwswenewnenwnwse
+neneeneneneenenewnenenenenenenenee
+neesenwnwseswseeeseesesewesesewee
+nwnwnwnwenwnenenenenewne
+eswnwsenewwnweswwnwsewwwnwwnenew
+swswswswswswsewswswseswseswseseswneswswse
+seneeneneenwneenwsenenewnenesenenene
+swswswswswwswwswswswneeswswswnwseswwwsw
+ewwnenwneswswswswneswneenewswse
+seswnwnwnwnwnwnwnwswnewnenwnenwenenenwne
+nwnwnwnwnwnwnwnweenwnwswwnw
+nenenenenenenwneneneseneneenewnenwnew
+eeeeeewseeeeeeese
+eswsewnewwnwsweneeeeeeenenwe
+wnwwwwwnwwnwwwwwsewwwwww
+senwseesenesweseenwweeesenewesee
+seswswswswsweswswswswneswswweswswnwnw
+eeeseweeseeeneeweeeeeeeee
+nwnwnenwneswnenenwneenwnwnwnenwnwnwnene
+nesenesweeswnenweeneneenenenwseeenw
+nwnwnwnwnwnwnwnwnwnenwnwneseewnwnwnwnw
+seseeseeeseseseeseeseeswnweseee
+neeswwnenewswwnwneseswsewneweseesw
+nwwswnewwnwnwnwneswnwnwnwwnwnwnwnwnw
+wswwnewswswswnewswwswseneswsw
+nwnwnwswnwnwnwnwwnwwnwwnwnwnwseenwnwnw
+swewnwwnewwwnwnwwnwnwseeseenw
+swswswswseswswswswneswswswswswseswsw
+neeneswneneenwswneswnenenwenewseneew
+enwnwnwwwnwswenwnwnwnwnwnwnwwswnwnw
+nenenwnenenwnwnenenwnwnwnwnwnenwnwnwnwse
+nwnwsesenwnewnenenwnwnwnwwnwnweseswnww
+swenwwsenwsewewwnwwwwwwneesww
+wswnwnwnwnwnwwwwwenww
+seseseseseswseeseseswseseseswsesenwswse
+wnwsenewwwwnwwwwswwwww
+seesweeweeeweeeeeeeneee
+nwwnwswwewwwwwnwwwwnwwwww
+nenwnwnewnwnwnwsewnwnwsewwnenwnwnwsesesw
+neenwsenewnenesenwnwnwsesenenwnenenwnwsw
+swswswswswswswseswneswswseswsw
+wneenwnwseneeneswnweseswsewsenenwnee
+swseswswswswswseswseswswswswswneswswswsw
+wswswswnwswseswwswswsw
+swswsesweswswswswneswswwse
+neswweeneewseneenenewseenenwesenw
+swwwweeseseswnwneenwnwwsewwwnwse
+neneneeneneeeneneneswneenwnwesweswe
+wnwnwnwsewwwnenwwwwnwwew
+nwswnesenwseseswseneeswse
+nwnwnwnwnwnwnwenwnwnwnwwnwnwwnwswww
+nwnenenwswnenwnwswnenenwnesenenenwsenenwe
+senwnewseenesweswneseseeesesesesesesesw
+eneneeweeneeeeeeeeeeeee
+eseeeeseseseseseeweseseseeseee
+wwsewwwswwwwwnewswswwwwww
+enwsweswsenwnwswswswswnweswswswseswswsw
+sesenwseswswsesewseseswseseseswseeneswse
+eweenwesweeewnwweewesesee
+seswseenwwnwsweswneeseswsesese
+seswneswswsewnwsweswnwwneswneswwswwse
+nwwnwswwnewnwnwnwnwnwnwnwnwwnwnwnwnw
+swswwwneneswwwwww
+nwswwsewnwnwswnwnwwswsweneneseenewnwe
+senwnwnenenwnwnwenwswnenwewswswswnwsw
+swwswswswswwswswswwswswswewswwwsw
+swsesewseseseseswseneswsesesesesesesesese
+ewseeeeswseseeeeeeeseeenwse
+nwnwnwnwnwnenwnwnesenwnenwsenwswnwnwnwnw
+nenenwwnenenenwnwnwnwnenwseenwnewnene
+wswwswwnwwsesewswswswswswswwwswwswne
+seenwweseseswnewenesenenenwswwnwnwe
+swswwseswewnewswwwweesenwswwswsw
+nwwnwenwwswnwnwnwnwwnwwnwwnwnwnwew
+wswswsenewswwswswswswswswwwswswsww
+wwwwnwnwnwnwnwnwewwnewwnwnwswwnw
+eswnesewseeeesesweenesenwnwseseseenw
+eswseseseeneseenwnesewwseeseswwsese
+esenesesesesenwswsesweswnwswweswsesese
+nwseesweeeewnwnwswewee
+nwwnwnenenenenwsenenwnwnwnwnenwnwnenenw
+wsenwnenwnwesenewnenwnwsw
+swswswneswswwswswswswseswwswswswswswswsw
+eeseweseseswseeseseseeesenwsewee
+nenenenwseneneneneneswenewsewswnenene
+eeneewswseswnenenenwnwswnwnwenwswnwswne
+swwnwnwwsweseewswwswnewwwswsesww
+swwseseswswswseeswsewswneseswswswsese
+neseseswwswsesesenwseseseseseswesesesese
+eewesweeeswseeswnweenwwnenwne
+swswswswseswnwswwswwswwwswnewsesww
+nenwnenesenewnenenenewneneneneneneeswnee
+wsweswewwswswseseswewnweseswenw
+nwnwwnwwwwsewwsewnwwnewnwnewnw
+seneeenwneeeeswneeseneeeenwswe
+swnwsenwnwneseseswseseneseseswwseeeswse
+nwnwnewewenenwnwnwnenwnenwnwnwnwnwnw
+neseneweenewneneeeeenenwneenenene
+ewseneneenenenenwneneneseeneswenenw
+nwnenenwnwnwnenwnwsenwnwnwnwnwsenwnwnwnw
+swwswswwwwswwwnenwswswsweswswwwsw
+eeseeeeneeenenwneneeeeenewsww
+seseeeeeeeeeeswneseeseseeese
+nesenewenwneeneneenenenene
+nwsesenwseewwweseseseseseeswswswneene
+swneswswwwwseeswwwwwwwsewwnwnw
+senwswseenwseswseswswseseswswswseeseswsese
+swseswswswseswnesesesweswswseneseswnwsew
+eeeweseeneeenweeeneenesenene
+eseeseseeseesenweseseeenwswsesee
+enwneeneeenenesweneneneenenenenenene
+swswswswswewswwswswswseeswswswswswsw
+sesewswwnweseswnesesesesesewneswsese
+nenenenwswnwenwsweeeeeneneneneese
+nwneswenwwwwenesewsenwwnwnwnenwsww
+neenwseseeseseseseswewnwnesewseswnee
+neneweneneneeswneneneneneneenenenenese
+sewneneeneneneneeneneeneneneneeenene
+nwnwwwwwsenwnwnwnwwsewenwsene
+eswsenwnweeeseseswseeeeweee
+seeeseseseeseseseseseeeeeeew
+neeeeseeenwneweeneesee
+nwswnwwenwnwnwnenwnenenwsenenene
+eneneneneenweneneweseneneneseswenene
+nesweeseeneseeswweweenenwseese
+nwwnwwwnwnwwnwenwswnw
+swswswwnenwswwswwwswesweswnwswwsesw
+nwsesenwnwnwnwwnwnwwnenwnwnwnwneenww
+wnwsewwsenwwwnweeewwewnesww
+nwnesenwseenesesesenesenenwwnwsenwwwwse
+nwnwnwnwnwnwnwneneenwsenwnwnwwnwnwnwnwnew
+sewsewwwnwnwnwnwnwwwnwnwnwnwnwnww
+ewnenewweswswwewneweeeneee
+swnwnenwnwnwnwnwnwnwnwnwnwnwswnwnwnenwnw
+nwsenwnwwseneenenwnwnwnwnwnwnwnwnwnww
+senwnwsenesenwnwneneswnenenesewnwswnenwnw
+senweenweeeesweseswnwewenesee
+wwewwnwwwwnwwnwwwwwwwswee
+seswsenwsesesesesesesesese
+nwnwwwewwnwwwwnwwwwwwwww
+seeeeeeeeeseeeeseswseseeseenw
+swwswswswswesweswswswswwswnwswswswe
+eneneeeswneeeeneeeeeeeeenw
+nenenwneeneneseneseneneneneenenwnwnewsw
+neeenwewseneenwneswnesenewswneneeene
+ewseseseseseseswneswseswswnwseswsesesese
+nwnwnwwnesenwnwnwnwnwnwwnwnwnwwwww
+nenweneeesweeeeeswewseswnwswe
+weswswswswwwswswwwwswswswswswww
+nenwsesesenweesesenwwnweseseswsenwse
+seeeeeseeenwseeseswseeeseesesene
+wnwnenenwsenwwnwweewnwwee
+seeseseseesesesesenwsesesesesesesesee
+wewswwwwwneswwww
+sesenwseseseseseseseseseseseeseseswsese
+seeneewsenweswesewwnwseseswswnwsesw
+wnwnwswnwnwenwnwwnwnwnwneneswnwsw
+seseseesesenesewesese
+ewneeenweseseesesweeseseeseseseese
+neneneseneneneneneneneneeeeneswnenenewne
+senenwnwnwnwnwenwnwnwnwnwwnwnwnwneswe
+wsweenweeseweeeenw
+nenweesesesewsweeenwse
+neneeneeneneneneneswneeneeeeenee
+swenenenwneneneneneneeswnwneneneneneee
+neenwneseneeenenewneweswneseenwnesw
+swwsenewswneswnwswwwwswswwwwwse
+nenwwswnewneseseswwsewwwnwwwwww
+nenwswnwnwnwnwnwnesesenwnwnwwnwwnwnwnwne
+wwswwwneswwswnwwwnewwwswwwse
+neeswseseseseswwseneseeseeseseesesenee
+nwnewnwneneneeneseneenenenenenewnene
+nwsewsweseweeswwsenwnwwnwneenesw
+eeeeseseeeseeseneswsee
+nwnwnwnwwnwwnwwnwnwnwnwwwwwswnew
+ewenenenenenenenenenenenenenenesenenene
+nwnwnwwwnwnwnwwwwwwwewnwnwnww
+nenenwneseseneseeswnenwwwwsenesenwnw
+eeeneeenweneesenwseesweswseew
+wswwneeenwnwnenwsenwswnwwnwwsesew
+eeeeesewsesenweeseseeeese
+eneesesesenweeneneswwnewnenenw
+nenwswewenesenenenwseneneseeeenwnene
+nwesenwsenwswnwnwnwnwnwnw
+nwnwnwwnwwsenwnwnwnwnwnwwnwnwwnw
+swneneswswswswseswswswswswswswswswswsww
+neswnewnwnwewwwwwwswwwwnewsese
+newwwwswwsewwnwnwwnwnwwwnewnw
+seswseseneseswwsewseswseseswsenesesese
+swswneenenenenwnenenenenenwnenenenenwnesenw
+sesesewseeseseseseswwseseseneseeeneese
+eeseneswsenenwwnwnenesewnenwnwnwswnw
+wnenwneneneneneneneseneneenenesesenew
+nwenwnwnwnwwnwnenenwnwnwnenenwnwnwnwne
+nesenewsenenewnenesewnenenwnenenenene
+wnwnwnenenwnwsenwwnwnwsenwnwnwnwnwnwnwne
+nesewnwswwwwswwewwswew
+wneweneeneeneneseewswwnenenewee
+wwswwnwseswswweswwwwswwswswnwsesw
+swswwswswswswneswswneseswwneseswswwswswsw
+wwneseswwwwswe
+nwsenwnenwnwnenenwnenene
+nenenenwnenenenenwnenwsw
+seswnwseswnwswneswswswsesweswswswnwsesw
+swneswnesewnewwwswswwwwnwswww
+swswnewwswswswswwswswswswswwswswwse
+swweswswswswnweswneeswnwseswswswnwsw
+swseswnesesesewneswwswneswnwseneswsenw
+sewwnwwnwnwwwsenenwnwswwwsenewwwne
+neneswneeenenweneswneneneswwneeenenene
+swseswsweseseswsenenwnwwswswseswseneesw
+nwenesenwsenenenwneswsweswnwnewesenw
+swneneenwnwseneeeswneneeneweenene
+swswswswwseswswseseseneswsweswseswswseswnw
+eesweenesweeeeeeenwweeeee
+nwnewneswwseneswswswwswseneswneseswsw
+eseeenweeeseseenwnweseeeswese
+neenwnwswnenenwenwnenwnenenenewnwnwnwnw
+neeeneneeeneenewsenenenweneneesw
+seseseseswwswswseseseseswswswswswswnee
+senwswsewseswseswseseseswseseesesesenesese
+swsweswswswwswwswswswswswswnwswsweswsw
+neeewnewneesewseeneneenenwesene
+nwnwenweswnwweseeesesweeneeseesenw
+sewwwwwwnwwwwww
+nwwneenwnwneswwenwnwnwnwneswswnwnwswnw
+esesweeeeneeeeneeeewseseeesee
+swsewenenenwneeseswwnewsenwneneene
+nenenwnwnwnenwnwenenwnenwsenwnenwnwnenenesw
+seseeswseneswswseseseswsweswwsesewsw
+esesenewnwnwwwswnwnewwnewnwwsew
+wnenwwswwswwswswswswwwswswwseesw
+senenenwnenenenenenenenenenenenenwnene
+swseneswswseseswswsweseswswwnwswsesese
+wewwswwnwwwnwewwnwwswwsewsww
+swswewsesweswseswseswswnwswnwswenwswse
+neeeeeneeeeneeneenesweneenee
+swseseseseswswsenwseseswseseseeseseseswse
+swnwnwnwwwnwnenwnwesenwnwwnwnwnwnwnwnww
+swneswwesesewswwwswwswswwswswwnenwsw
+nwswnwsesenweeseswwswseswseswesenwse
+swwnwwnwnwwnwnwwnenwnwnwwnwnwwnww
+wneeswsenwswseseswwesw
+neeenenwsweneseesweenenweeneeee
+nwneeswseneswnwsenwnwsenwnwnwnenwnwnenw
+sewwwsewswenwswswnwnw
+wnwnwnwwenwnwnwnwnwsenwnwnenwwsw
+wwswswwswwwwwwswswe
+eeeneeeeeeseneeenweenewnee
+neeesenenenewneeneeneneneenwnesw
+wwwnewseewnwwwewwwwwwnwwse
+seseseseseesewsesesesesese
+eseeeeweeneeeseesese
+swswswswnwwwwwwwwswwnewneswese
+seswsesenwsenwnwsweseswswwseseswseese
+swswswswseswswnwswswewswswswswswswswsw
+eseeseeneewesewenweeeeseeesw
+nwenwseneswswwswswnwseswseswwneswsweesw
+wnwsewsesenenwneseswnenenwnw
+nwnwnwsewswnwnwwwnwwnenwnwwnw
+ewwnwnwnweswenwsenwwsesenwnwsenwewnw
+eseeeeeweeeswneeseewenwneee
+neswswswewswseswnwswseswswsw
+wwnwwnwswenwnwwnwnwnwnwnesesewewne
+nenenwnwnwnwneweneneneenenenenwnwnww
+wneeeneeneneneeneeneeeneenenesee
+swwwnwswswwnewswsweswwwswswswswwsw
+eeeseseseseseewsewseeseseneewsese
+wnwenwnwwenwnwnwwwnwsewwnwse
+eswneewseseeseswneeseenww
+wwnenwwwswnwnwswwwnwwwwwewww
+neswnwswnwwswwwnwneeneswswwnwnewnw
+swseneswseswnwwsenwswwnwswseswnesesene
+nwswnwnwnwnwswwnwnenesenwnwnenwnwnw
+swswnewswwwswswwwwwswswww
+nenenenenenenewnenenenesenenenenenenene
+wwswnwwneswwswwwwsewswswwwswswsew
+eseeweeeeeseeseneeeesesesese
+eeeeeseeesweenenwneeenweeee
+swsewsesesenwnwseseneseseeneseeseswese
+eeeenwseeeeeneenene
+eweesenwseewne
+nwnenwnewneseenewswsewsenwnwnwneswnesenw
+esweeswseseneseeseeeseeeeeene
+enwnenwnwnwenwwnenwwnweseswswnwnwnenwne
+eenesenwnesenenenenwneneewnenwswsene
+seswseseewewseseseseseesewseseswswnw
+nwnwwnwenwnwnwnwnwwnweseswnwnwwnwnw
+neseswswswswsesenwnwnwwsenwneseswwwsewe
+sewwwwwnwwwnenwnwnwwwwwnwnw
+wwwewswewswwwwswwwwwwwsw
+swseeswseseneeeseeenwneneswewswne
+neeswwnwneenenwnenesenwenewnenenewne
+swwwwswwseswswwswswswswnewswwswsw
+nwnwnwwwnwnwnwewewwswnwnwnwwnww
+swswswswswswswswswswswwswswswswwswswne
+weswswswnwweswneswswswswseswswenwswswnw
+nenenwnenenwnenwnesenwsewnenenwnenenenenw
+nwswnwnwsenwnwnwneewwseseswnwnwseneenw
+seswneseseswneseswnwseewsewse
+senwseeeseeeseseseseeseseseseesesw
+enenwsewnwsewwnwnwswnewwwnwnewsw
+wwswwwnwwsewnewnwnewww
+nwswneseneswnwsweswswwswswswswnweenwesw
+swwswweswswswswswswsweseneswneswwww
+wewswwwwwwnwwwwwwnwnwwww
+neswwwnwwswwseswswwswsewnwswwswwsw
+nenwneneneneswnenesenenenenesenenwnwne
+wseseseseseeseeeseseeesenew
+swseenwnenenwswnwnwwsweenwneneseenenw
+eeswsenewneseweeeswsesesesewnwnesese
+nwseeeswseswwwnenesenwseswwseesesesesw
+nesewnenenenenenene
+wnwwnwwnwwnenwewwnwwwnwnwnwnwswse
+neneneneswnenenenene
+nwnwnwnwnenwnwneeswenwnewnwnwneenewnwne
+eeeeneeeeneneneneeenwneswneswenwne
+nenwnenwwnenenwenenwnenwenwneneswnene
+nwnwnwwnewwwnwwwsewnwwwwwnwwnw
+weswswsesweswneswnwswswswswswsweswsww
+neneeneewneneneneeneswnenenenenenene
+wswwwwnwnewwwwswswnwswsewsewsw
+swswsenwseswseswnweswsesesesesesesesesese
+nenwnwnwneneenenenenenewnwnwnenenesenene
+swseswswwswsenenwseswswseswswseseswswsese
+swswsesweswneswswswewnesenwseswnene
+nenesweenesenenenenwnwneswnenwswsenwnwnw
+wewsewswseswwnewswwnwwnwwswwwsw
+nenwnwsenwswnwnwwnesenwnwnwnwnwnwenwne
+sesenweseeseseseseneeseseeseseswsese
+seweswwwnesenwwnwnwnw
+sweseseseswneewsenweseneseeseesee
+neneneeeeeneneneenenenenenenenewnew
+nwewneswsweenwsesewesenesewneesw
+eseseseseenesenwseeseeeew
+nwswswseeswswseswseswswswseseseseseswswse
+nwnwwnwnenenenwenenenenenenwneenenenenwsw
+neseswswseseswswsewseseseseseseneswsesw
+seswswswseswswnwseswswswswswswswswswsenese
+wseswwnwewnwnwwwwwsweswnewnwenew
+sewwswwneswwwwswwwenewwwswew
+swseswswseseneseseswswsewseswseswseswsw
+wsesesewseseeeseseesesesesesesesesee
+nwnwnenenenwnenwnenenenenwnenenenwsenwnw
+senenwswnweseswnenweneswwsw
+neeeseeeneeneneneneenwnenenesenwe
+nwwnwnwneswnwwnwswnwenwnwnwnwnwwnenwe
+seseswewseswswnwneneseseneswswsewwsesw
+nenewneeneswneeneneneseneneeneenene
+neneeeneeeeeeeeneeeeewene
+wnwwenewnwnwnwnwwnwnwnwwnwnwswsenwsenw
+wwsewwswnwwwwwwswwwwww
+swsweseeswsenwseseneweswswswwswswsesese
+nwwnwnwnenwnwnwsenwnwnwnenwnwswnwnenw
+sweswswswnwswneneneenwswswswswswsesww
+neenewnwnwnenwnenenenewnwneneenwnwnw
+nwnenwnwnenenwwseenwnewnenenene
+nenenesenwswnenenenwnenwneneneenenwne
+neeneeneweneeneeeneeenwese
+swwneswnwswwsewswneswswseswswwswswnesw
+swseseseseseseseeesesesenwseseseesese
+nenweswseswswwsewswswnwnewwnwnesesew
+swseswseseswswneneswswsenesese
+nwseswsesesenwsesenwnwsenweseewwsese
+neseeneeneneeeenenenenenenenewnew
+nweweenwnwewseseseseesesese
+esenwwnwswnenwwseeswswewnwswenesesese
+neenwnwneseseseewneenesewnenenenenew
+nwnwnwnwnenwnwnwnwnwnwswenwnwnenwswnwnwnwnw
+swnwseswseeswnwswsw
+wenweeseneswneswnwnwwneswseneneseswsw
+nenenewnenenenenenenenenesenwnenenenwnene
+seswnenwseeseswwseesenwswseseeeee
+eeeneeeeweneneeeeeeeewee
+eeeeeeneesweeeeeenweeee
+eeneneeneeneeneenwneseeeneeene
+wwwwsewwwwwwwnwwswewnwwsww
+wwwewswwwnwnwnwnwwwwwnww
+senwswsewwneseneswnenewwwenwwe
+seeesesweseseneswnwseesewseeseew
+swwneewwswswwswwwswswwswnewwww
+swswwswswswwseswneswswwwwwwwswswsw
+sewnwswwnwewnwwwwnenwnwnwnwewsewne
+nenwnwnwnwwnwnwneswnwnwnwnwswnwnwnwnwnw
+eweseneenwneenewneeeeneenewse
+nwwwwwsewsenwwnwnwwweswnwswnwnee
+eeeeeseeseesweenweseeeeeee
+eneenesenewnenenenenwenenesenenenene
+wwwwwwnwwwwwseewwwwwwww
+nwnwwwnwnwwenwwwwwwnwwswwnwww
+swnesesesesesewseseseseseseseseseesesesew
+nwnwnwnwnweswswnenwnenenenenwnwnwnenwnw
+wwwwnwnewnesewwseswwenwsewwnwnw
+sewwwwwsewswwwnesewwnwwwwwwne
+swswnwswswswnwswwswswswswwseweswswsw
+wwnwswwwwwwwwseseewwnwnwnwww
+nwnwswnwnwnwnwnenenenwnwnenenwnenenwnesw
+eeeeeneeseenwesweneweneene
+nenwwnwwwwnwwewwwwwsewseswwnw
+nwwswswswnwwwsewwewwwweswwe
+seswswwwswswnwwnwswweswweswsenwnw
+nwnenenenenenwneneneswnenwnenenenenenene
+neeesweeeenesweeeeeeseeee
+eswswseseseswswswswswweenewnwswseswsw
+eeseseseeseesesesesenwswseseneseesw
+seeeeseseeeeeswenwseseesesesesese
+neneenenwneneswnenwneneseenwnenesenenene
+senwnwnwnwnwnwnwnwnwnwnwnwnwnwnwnwnwnwnw
+neeenenenenenenenenweesweenenene
+wwwnewwwwwwwwwwwwwwswwse
+eeeeseeeeeeneesweseee
+seswswnwwswseswswswswswwswnwswwswww
+eseseeseeneesweswseseeesesesesenw
+seseeseeenweeswesenesesesenesewe
+seneseseseseseseswseeesesesesesesenwwenw
+seeeeeeeeweseeeeeeeeee
+neenwneneneeeneneeeneneneneeneeswne
+wwwwwwwwwwwwwwnwwnwwe
+seseneseseseswsenwswswswseseswsenwseswsesw
+wwswwwnenwwwenwnwsesesweswwwwnw
+wwwwwswwwnwwsewnwwnenwnwnwnewse
+neneneneeewneneneneeseeneneneswee
+nwnwnwnwnwnwnwenwnwwnwnwswwnwnwnw
+nwseeneseseeeseeseenweswsweeesese
+eswneneenenenwnenenwneneneneneneswswnwswnw
+seswseseswswswswswneswswswseswseswsesese
+eswnwneeseewenesweneseneeeenwnenw
+wnwnwnwnwnwnwwnwwnwnwnwsenwnwnwnwnwnw
+swwswwwwswneswwwwwwswwwwnesw
+seseewswweswenwswsenwswnenwswswneeene
+swswswswseeswseswswswenwswwswewswseew
+senwnenwswswswswseewswwnewswswsenesw
+eneneneeeeeeweneeeneeesewneee
+nwnwnwnwnwnwnwnwnwwwsewwnw
+wwsesewsenesweneneseeeseswnwnesew
+eeneneesweeeseswwneeseseeeeew
+senesewwenwneswsenweeswswsenwswswnesw
+nwnwwnwnwnwnwwwnwwnwwnwnwnwwsewne
+seswseseswseswswswneseneseswswwseswsese
+sesesesesesesesesesesesesesenwsesesesese
+seeseeeeeweeeee
+sesesenwsesesenenewseswswseseseseseseenw
+nwnwwewwwnwswnwnwwnwwwwwnwww
+wwnwnwnwnwnwnwwnwnwswenwnwnw
+neneneneneneseneneneeneneneenenenwnene
+wwnwsenwnwnwnwnwnenwnwnwnwnwnwnwwnww
+newnwnesewnwsewsenenwswnwnwnwnwnwnwnwnwnw
+senwsenwnwnwnwnenesewnenwnwnwnese
+eseseseseseseseesesesesenw
+neseesewsenwseseswseseseenwnew
+swneswwswseswswswseneswnwseseswwseseswse
+wwwewwnwwwwnwwwwnwwwwww
+nenenesenenwnenwneneneswnwnenenwnenenenw
diff --git a/2020/src/bin/2020day24.rs b/2020/src/bin/2020day24.rs
new file mode 100644
index 0000000..8035877
--- /dev/null
+++ b/2020/src/bin/2020day24.rs
@@ -0,0 +1,219 @@
+use aoc2020::*;
+
+// Hex directions are defined as follows:
+// We have an x/y coordinate.
+// x is the west/east direction (east +ve)
+// y is the north/south direction (south +ve)
+// Each time you move north, x shifts westward 0.5, so nw doesn't adjust x
+// Each time you move south, x shifts eastward 0.5, so se doesn't adjust x
+
+#[derive(Debug, Copy, Clone)]
+enum HexDirection {
+ East,
+ West,
+ NorthEast,
+ NorthWest,
+ SouthEast,
+ SouthWest,
+}
+
+impl HexDirection {
+ fn offsets(self) -> (i32, i32) {
+ match self {
+ Self::East => (1, 0),
+ Self::West => (-1, 0),
+ Self::NorthEast => (1, -1),
+ Self::NorthWest => (0, -1),
+ Self::SouthEast => (0, 1),
+ Self::SouthWest => (-1, 1),
+ }
+ }
+
+ fn list_from(dirs: &str) -> Vec<Self> {
+ let mut ret = Vec::new();
+ let mut dirs = dirs.chars();
+ while let Some(c) = dirs.next() {
+ ret.push(match c {
+ 'e' => Self::East,
+ 'w' => Self::West,
+ 'n' | 's' => match (c, dirs.next().unwrap()) {
+ ('n', 'e') => Self::NorthEast,
+ ('n', 'w') => Self::NorthWest,
+ ('s', 'e') => Self::SouthEast,
+ ('s', 'w') => Self::SouthWest,
+ _ => unimplemented!(),
+ },
+ _ => unimplemented!(),
+ });
+ }
+ ret
+ }
+}
+
+#[derive(Debug, Default, Copy, Clone, PartialEq, Eq, Hash)]
+struct HexCoord {
+ x: i32,
+ y: i32,
+}
+
+impl HexCoord {
+ fn walk_to(mut self, path: &[HexDirection]) -> Self {
+ for (xofs, yofs) in path.iter().copied().map(|d| d.offsets()) {
+ self.x += xofs;
+ self.y += yofs;
+ }
+ self
+ }
+
+ fn neighbours(self) -> HexNeighbours {
+ HexNeighbours {
+ loc: self,
+ dir: Some(HexDirection::East),
+ }
+ }
+}
+
+struct HexNeighbours {
+ loc: HexCoord,
+ dir: Option<HexDirection>,
+}
+
+impl Iterator for HexNeighbours {
+ type Item = HexCoord;
+
+ fn next(&mut self) -> Option<Self::Item> {
+ match self.dir {
+ None => None,
+ Some(d) => {
+ let (xofs, yofs) = d.offsets();
+ let ret = HexCoord {
+ x: self.loc.x + xofs,
+ y: self.loc.y + yofs,
+ };
+ use HexDirection::*;
+ self.dir = match d {
+ East => Some(West),
+ West => Some(NorthEast),
+ NorthEast => Some(NorthWest),
+ NorthWest => Some(SouthEast),
+ SouthEast => Some(SouthWest),
+ SouthWest => None,
+ };
+ Some(ret)
+ }
+ }
+ }
+}
+
+fn _part1(input: &[Vec<HexDirection>]) -> HashSet<HexCoord> {
+ let mut flipped = HashSet::new();
+ for path in input {
+ let tile = HexCoord::default().walk_to(path);
+ if flipped.contains(&tile) {
+ flipped.remove(&tile);
+ } else {
+ flipped.insert(tile);
+ }
+ }
+ flipped
+}
+
+fn part1(input: &[Vec<HexDirection>]) -> usize {
+ let flipped = _part1(input);
+ flipped.len()
+}
+
+fn part2(input: &[Vec<HexDirection>]) -> usize {
+ let mut tileset = _part1(input);
+ for _ in 0..100 {
+ let mut neighbours: HashMap<HexCoord, usize> = HashMap::new();
+ // For every flipped tile, note its neighbours
+ for tile in tileset.iter().copied() {
+ for neigh in tile.neighbours() {
+ *(neighbours.entry(neigh).or_default()) += 1;
+ }
+ }
+ tileset = neighbours
+ .into_iter()
+ .flat_map(|(loc, ncount)| match ncount {
+ 2 => Some(loc), // 2 == always black
+ 1 => {
+ if tileset.contains(&loc) {
+ Some(loc) // 1 and was black before == still black
+ } else {
+ None // 1 and was white before == still white
+ }
+ }
+ _ => None, // 0 or > 2 => white now, no matter what
+ })
+ .collect();
+ }
+
+ tileset.len()
+}
+
+#[cfg(test)]
+mod test {
+ use super::*;
+
+ const TEST_INPUT: &str = r#"sesenwnenenewseeswwswswwnenewsewsw
+neeenesenwnwwswnenewnwwsewnenwseswesw
+seswneswswsenwwnwse
+nwnwneseeswswnenewneswwnewseswneseene
+swweswneswnenwsewnwneneseenw
+eesenwseswswnenwswnwnwsewwnwsene
+sewnenenenesenwsewnenwwwse
+wenwwweseeeweswwwnwwe
+wsweesenenewnwwnwsenewsenwwsesesenwne
+neeswseenwwswnwswswnw
+nenwswwsewswnenenewsenwsenwnesesenew
+enewnwewneswsewnwswenweswnenwsenwsw
+sweneswneswneneenwnewenewwneswswnese
+swwesenesewenwneswnwwneseswwne
+enesenwswwswneneswsenwnewswseenwsese
+wnwnesenesenenwwnenwsewesewsesesew
+nenewswnwewswnenesenwnesewesw
+eneswnwswnwsenenwnwnwwseeswneewsenese
+neswnwewnwnwseenwseesewsenwsweewe
+wseweeenwnesenwwwswnew"#;
+
+ #[test]
+ fn origin() {
+ let dirs = HexDirection::list_from("nwwswee");
+ let origin = HexCoord::default();
+ let neworigin = origin.walk_to(&dirs);
+ assert_eq!(origin, neworigin);
+ }
+
+ #[test]
+ fn testcase1() {
+ let input: Vec<_> = TEST_INPUT
+ .trim()
+ .lines()
+ .map(|l| HexDirection::list_from(l.trim()))
+ .collect();
+ assert_eq!(part1(&input), 10);
+ }
+
+ #[test]
+ fn testcase2() {
+ let input: Vec<_> = TEST_INPUT
+ .trim()
+ .lines()
+ .map(|l| HexDirection::list_from(l.trim()))
+ .collect();
+ assert_eq!(part2(&input), 2208);
+ }
+}
+
+fn main() -> Result<()> {
+ let input: String = read_input(24)?;
+ let input: Vec<_> = input
+ .trim()
+ .lines()
+ .map(|l| HexDirection::list_from(l.trim()))
+ .collect();
+ println!("Part 1: {}", part1(&input));
+ println!("Part 2: {}", part2(&input));
+ Ok(())
+}