advent-of-code

Perserverance, or the lack thereof

git clone git://git.shimmy1996.com/advent-of-code.git
commit b585df7d57594a820b99444d7f420891e2d75e6c
parent 41df761c54d3c40adbdeab70554cffb38d5e67c2
Author: Shimmy Xu <shimmy.xu@shimmy1996.com>
Date:   Thu, 24 Dec 2020 18:12:00 -0600

Add 2020 day 24

Diffstat:
A2020/day24/input.txt | 450+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
A2020/day24/main.go | 135+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 585 insertions(+), 0 deletions(-)
diff --git a/2020/day24/input.txt b/2020/day24/input.txt
@@ -0,0 +1,450 @@
+swsenwsewneeseseswnwswsesesewswnewsese
+seewwewsenenwwswnwwenewwwwwwnw
+swswswseseswswswseswswswswseswswne
+ewesewseseweswnwneesewesenweneee
+seewneneswenenenenwneswnwnweeswswenene
+neneneneewwsenenenenenwnenenenwnwnesenw
+eseeeeseeeeeesewee
+eeneeneeneneeweneeeeene
+swseswsewseswseswswenwswseseseswswswwnene
+nwnwseswswsweswnwseswsesesw
+eswnenweeseseswenwswneenweseseee
+eswseseeswseeneeswseneseneseeeesee
+nwswseneseseseeswnwseseseseseswswsesese
+eesweeneeeenwnwnewesweeseeee
+wwswwwwwsewwwwwwwnesw
+swswswswnweswswswswsweswswswwswswsesw
+eeneenwseewswsweewseewenwewe
+seseseneseseswsewseseseseseseswsesesenw
+nwenwswnwnwnwnenwnwnenenwne
+enesenwnewneenewneneeseneneenwswne
+nwnwswsenwnwnwsenenwnwswnwnwnenwnwnwnwnwne
+nwnwswswwwnenwenwnwwsenwwnwnwnwesenw
+ewwswnenenesenenwnenwnesesenwseneewwne
+nwwnenenwnwnwnwnwnwnwsenwnewsewnwsww
+swswwwsenwnwswwsweswsweswneswesesw
+nenenenenenewenenenenwneneseneswnenwne
+esweeseeeenwnwseeseeeeseeee
+ewsesenesewswswsewneswswneswswseewsw
+nenweeeswneeeneenwenwseenwneswswne
+swnwnwnwnwnwneneseneneneswnwnese
+senweenwnwseswswswnwnwewnwnwnwneswswne
+nwnwswnwwewwewnwnwnwnwsenwnwnwwnwnw
+nwsenwsenesenewsewwwnwsenenewseww
+eeesenewweneeneweeseswswsesesese
+wneeeenewnenweeseeneneneseseneee
+nwswwswswswswswswswswwwsweseswnwsww
+senwenwnwnwnwnwnwnesewnwnwnwnwwsene
+swwnewwwenesewwswswsewwwwwswnww
+swwwewnewwnwnewnwwswwnwnwwww
+neeneneneneneseswnwneneenenenenenwne
+seseswsewseswnwsesenesesesesweseeseswsw
+nwsenwenwwnwnwnwnwnwnwnwswwswwwenwnenw
+enwnwsenwwwnwwwswewnwwnwnwwnwswese
+wwnwnwnwwwsewsewnwsewnwnww
+wswswwswseswwswwswswwwswwwne
+ewwswwswswwwsesweswwwwwnewwew
+neeseseswswenwwnwsenenenwwneneswwsw
+nenwsenwnwnwsesenenwswneneenweseseesew
+senenenenenenwnenwswneneneneenenwnesene
+wswwnwswswswseswesewswswswnwsw
+wwwewwnwwswswwwnewswswswnewnwse
+seseswseswsenwneseseenwseswsesesesesese
+swseswnwwnwneswseswswnwswseswswseenesw
+nenwswwnwsesewseswseseswseseneeswseswne
+swswseswseseswwnwswseswnwsesenesweswe
+swsenenwneswnwwsewewwnesew
+swsewswsewsewswswswswswswwswnenwwwnw
+swsenwwneswnwnwneswseeswswsenwswenee
+wnenenenenenesenenw
+swseenwseseswsenwneenwwswswsesenweswse
+seseseseseseseswsesesenesesese
+nwswnwnenwsenwsenwnwnwnwnwnwnenwnwnwnwenw
+seneneneseswnwnwneswnwneneseswnwnwnwnwwnw
+nwnweenwnwswnwnwnewenwwswwneseesenw
+nenwnesenweneneneneswwnenenwnwseneneene
+nenwnwnwnwnwnwnwsenwnwnwnwnwnwswsenwnwnw
+nenesenenewnenenenenewnenesenenenenenw
+nenesweenenwnenewnwnesenewneneneeene
+wwswswwsewwwswnwnewenwswwswswwswse
+nenwswnenwneenenewswnewnenenenwnwsesew
+nwwsenwsenwnenwsenwsewewneswnwnewnwne
+nwnenwnwneweswnwnenwewnenenenwneswene
+wwwnwnewwwsewnwewwwnwnwwnwnw
+wswnenenwnwswneneswnweenwnwwnwnwnwnw
+nwweeswneneeneeenwneseeeeswswswe
+seeswseseswnewsewwnwseewneesesesesese
+wnwnwnwnewnwwsweeswwnwwnwswnwnwew
+wswnweenwwswsewnwnenwnwwswwwww
+eneswnewswesesenwneneenenenwwenwne
+swwswwwwnewsewwwwswewswwww
+swsesenwnwsenewseseseseseseseseseewsese
+wnweweenenewnesweseeseeee
+nenwwnwnwnwnwnwsenwswewswne
+nwsesewnwseseswneenewswneesese
+eneeeeweneeeeeesweeewewse
+wseeeseeseeesee
+nwnwnwsenwnwnwnwnenwnwwnwnwswwewww
+nwsenwnenwsenwewswnenwnwnwnwnwnwnwnene
+nwneneseswswswwswwneswseewswswswswsw
+swneneswswswswswswswswswewswwswswswsww
+wneseeseeeeeweeseneeseseesew
+swswswseseseswsesesesesenesw
+neswewseseneswswswswseswswswswwseswswse
+nenenwsweswneeeswnenenenenewnenenee
+swswswswswesewswnwnenwesenewswswswnesw
+eswswnenewewwswwswneeswswseswwsw
+swnwwnwswsesesenewwneeseswseenenwne
+weweswwsenwswenwnwnwenwwnwnwwnww
+eseseseseseeseewsesesenwseseneeswsese
+senwseseesewneesesesesenwsenwseswsesesese
+eneeeneeeeeswsweeeeeeeewse
+seesesenwsesweewswseseneneneswnesewe
+wswnwwseswwnweswwnwnweneeswnwswnenenw
+nesewswwwnesewnewwwsene
+swseswsweseseswneswswsewseswswsww
+eseseeeseswswnwweeneeeesesesene
+seswneeeneewneswesesenwnwwnenewnwsw
+newsenwewnwneeswseswsesesesesewsenwse
+wwwwwwwnewswwwwwnwnwswwew
+swnenwnwnwnwswswnwenenwnenwenenenwnenw
+wwwwewswwweewwsewwwnewnwnw
+nwewwnwnwswwswnwewwwwnwnwwwneswe
+newneswneneneswnwneneesesewneneesww
+nwnwnwneseswnenwnwnwswneeneswnenwnwnwneesw
+nwwswsenwneweenwwenenwwwsenw
+nenwneswswweneswseseeseneneeeneneew
+eseseeseeeeseenenweeseswenweenw
+neswneseesweeswesenwswenweeseeeenw
+wenwseeseneneeeneneneeeweswsene
+neenenenwneneneneneneseneneswnenenene
+nwnwswnewewseswsw
+neswneeswwswseswswsenwswseswsenewesesw
+seseswseeeeeewenweeeeseesee
+wwnwswnwnwenwwswnwnwenwnwnwwnwwnw
+wswneseenwnwesenwwnwnesenwnwneenenwwnw
+newwswswsweswsenwneneswswwswwswswsw
+eswnwsweswswnwswswnwwwswswswesewswswne
+sewswswswswswneswnwesesewneswswswswsese
+newswneswwnwwswwwswwwswwewsewsw
+nwswswneseneswswswwswswwswwswneeswsw
+nwnwsenenenwwswnweesenwwwnenesesenw
+nwneswnwswnwwnenenwnenwnwnenenwenwnenw
+wsenwwnwsenwnwenenwwsewsesesewneww
+eeneeesewseeee
+nwnwnwseswnwnewwwneeseseswswswneeee
+neswswswswswswswswswsesw
+nwwswwneswsewwswwneewsweswswwww
+nwnwsewnwsenwnwwnwnwnwsesenwwwnewnenw
+wsenwseseneenwnenwwenwnwwsenwswneswsw
+wwwswswswswswneswneswswswseswwseswwnesw
+swsesesweseenwwsesesweswswwsenwswswsw
+seeneeesweesese
+swnwseswsenwnwenenwseneswsesesesesesesese
+nwwwnwsewwnenwwenwnw
+wseseesenwseswsesee
+nwnewwnwwwnwwwwswwwnenwesesww
+swswnwswsewwsewnwwseneswswnwswsewsw
+nwnwnwneneswneseswenwnenenenwnwneswnewese
+senenwwnenwwsenwnwnwwnwnwnwnwnwnwnw
+newnwnwnwneswnwwnenesenwnwnwneenenwne
+enwnwnenwnenenewnenwnenese
+nwneewwesesewwwnewsewwwww
+sesenwseseseseseesweswenwseseeseese
+seseseswnweswseseseseseneswswseswseswnwse
+swwsenwseeenesewwwenwsweesesee
+wsewneneeenenenwneneneweeswnenesesee
+enwweewseeneswenwewwenwswesee
+seswneseneswwswseeswswswswneseswswsw
+nenwnenenwsenwnwnwnenwnenenwnwseswnenwnw
+newswwwwwewewswewseewswswswnww
+seeseseeseweenwse
+eswseseenweneswnwseesw
+nwnwnwneenenwsenenenenenwwnwnwneneswnenw
+eeenwneeesweeeneeeeneneswene
+seswswsenesenewseswneswwswswswseswswnw
+eeeswneeneenesenweesenenewneneee
+neseeeswwneweneenwewsweweee
+nwnwneneswnwneenwwnwnwnwnenwne
+seswwsewwwnenenwsenesewwswnewwswnw
+nenenenenewnenesenenw
+nwsenwnenwsenwnenenwnwnwnwnwnwnwnwnenw
+seeesenwswwswwweseene
+nenwnwnenenenwnwneneswneneneneneenenwsw
+swwseswnwnewsesewwswwswwswswnwswnw
+nenwswneneswneneeeseeeneneenenwenee
+nwnenenwseswewswsenenenwnenwnwenwnenww
+swswseseswwnenenweseseswnewswswwsw
+wswswswswwneswswswsweswswswswswsesww
+nwnwwnenenwswnwnwswnwwnenwesewsewnw
+seneswwenwnwswnesewswwwneenwswsee
+nenweneenenenenewnenenesewseneneenenene
+neeswneneeneeneeswneenwenesweene
+eswnenweenwswesweseeeeewewneee
+nwswseswnenwnwnewwnwnwwnwnenwnwnwnwnwnw
+newnenenenenenenenwnenesenenenee
+wseswswswswseswswnwsenesesw
+nwsenenewwnenenenesenenenenenenwnw
+swseswswneswswnwswswseswseswsewswse
+esenenenwnwnwnwnenenewnenwnwnenenewsene
+wnwsenwenwnewnwwnwnwwwnwsewnewwnw
+nwnwnwsenwnwwnwnwnwenwnwewswnwnwnwswnenw
+wwwnwnewwwsewwnewwwsewwww
+nwneneneneswnewnenenenenenenenesene
+nwwwswswnwwseewenewewwwwsesw
+nenweeenewweneeneneeswnwesenee
+sweneswnwsewweneneeenweseneweeene
+neseeswswnwneeeeenwwneenwneesesw
+swswswswseswswswneswswweswswwwweswsw
+newenesewneneeneseeneswnweneenene
+sewneeneneswwwnwneswseseseeseseswse
+swseswneswswseseeswwnwnwswenwswnw
+nwnesesweenweseeenweeweeseene
+swswwneswseswswswseswswswseneswwseswse
+seseneseseeswesweenesesewsenwesesesee
+neeeseneswnenenenweenenenenenew
+swnwnenwnwsenwsenwnwnwsenenenwnwsenesenwse
+swwneseswswnwseswswseseseseesesesesene
+swneswnenenwnenenenenenwneneneewnenwene
+wwswwwnwnwwwwneewwwwnwwwsw
+sesesenesesewseneseewseseseseswseseswse
+swsweswswwneswswswswseswswsw
+nwweswswseneswsenwenwwwnwswswwnewe
+seswswswswnwseswswswswswswswenwswseswsw
+seswswseseseseesesenewsenwsesewnesesw
+neeneneeneneneenesenenenenenenw
+nwnwnwnwsenwnenwnwnwnwnwnwnwnwnwnw
+wseseesenesesesesesesesw
+nwsewnwswwsewnwenwnwsenesenwnwnwnwnese
+nwwneswenenenenenenwnenenenwnwnenesene
+wwwwwseewwwwsewswwswwwswnenw
+swewswswswswwnenwnwswweewswswwsw
+senewenwneswseswnwswnewnewnwee
+nwnwwwwwwenesenwwwnenwenwwwswswne
+nenwnenenesesewnwsene
+neswwswewsweswwwswnwnwwnwwewsw
+wswswswswswwnewswwwwwswww
+seseseseswesenwseewnwswseseseseswsewse
+swswwsewseeenwsweswneswnwwenenww
+wwnwwsenwwnwwwwneewnwswnwnenwwnw
+eseswseneseswswwsewseseeseeswswsesew
+swwswswnwseswnwneneeseswsenwneswswsesw
+sesesweswneswswnwwwswswswswswseswswsw
+seseeeeseewseseeeseseseenenenwswsese
+seneswseseswsenwswnwswswswswswswseswwswsw
+wnwwwwnwwwwnwnwnenwnesewnwsewsew
+wwwwwswnwnwswweenwwwnwwwww
+swesewwswwwnenewwswsewewwwww
+nesenewneneswnenewewneneneene
+seswwswseswseseswswneseseseswsesesenese
+neswswswswswswseswswneswswswsenwsweswswsww
+sesewnewneseseseswswswnwseswsweneswnwne
+nwwnwwwwnwwewnwwwswnwneenw
+wnwwwwwewwswwwswewwwwew
+swswneswswswwswseswseswseswswswseswnwse
+wswsesenwsenwseswseswswseswswswswswesese
+swnenesenenewseswnwswenwnwwnenenenwne
+senenwswneeswneeswwseswwnwwswswswsw
+esesenwseeseseseneweseseeseewnewsew
+wnwwenwwwnwnwnwnwswnwenwnweewnwe
+swewwewwwnwseswswneneswnwnewwnwnw
+sweeeneeneswnenwenene
+nwneseseeenwnwnwweseswewnewneseeswe
+eseeeseeeeeseseeeweweneneese
+swwwswwneswswswswswswswswwenewwwnwse
+nenwnwsenwnwwnesenwnwwnwnesenwnenwswnenw
+neenwnwwenenwnwnewswsenwneene
+swseseseeswswswsesesewswsw
+wewwnwnwewnwwwwwwwnwwwew
+weenwsweseewseseseneseewneeeee
+sesesenwseseseseswsenwneesesesesenwsese
+seeneseseweeeewseneswseeseeee
+newewswswwwswwswswwwswswwseswsw
+nweswnenewenenwswsweeeswneewnwesee
+swwswswewwswwwwnwwswswsw
+nwwnwnwnwnweeswwnwnwnweneseswwww
+wwnwnwswnwsewnwwswnwnesewnwnwnwnwwne
+nwnwnewnenwsewenwwneswnwnenenwneesene
+sewnwwswwnesewwsewnewnewsenenwse
+swnenwnwnwnenwnweneswnwnwnwnesenwnwnenw
+nweeseenwsesewswneenw
+sweeeswseeseseeesenwseseseenwese
+eneeweeeeeeweseeneseeeeeew
+wwswwwwwwwswswwwswweswwe
+wnwsewseseseewswnenwweneeenwsesew
+swwseswswswswnwwwweswswwwnewwsww
+swewwwswwneswswswswswnewwswwswwswse
+swswsweswnwswwwswewwswswswswswswsw
+nwsweseseseseseseeseseeseseneswsesenw
+seswswswswnesenwswswseseseswnwnwewseswsw
+wwwwwnwnwewneswwwsenwwwnewwsw
+nwneseneswwseswswseseseswseneseswswnesesesw
+eeneenwswneenewseeneneenenewswe
+seeenweseeneneneeenenwswwnwswee
+eneeesesweeenewnwneneenenenwene
+swseseseseswewnewsesenwswneseswwseenesw
+wsewwneswswnwwwwwww
+swswswswnwswswsewswwneswweeswswswwswsw
+sesesesesesenenwsesenesewseseseseeseswse
+neneenweeneeeneneenweneneswsweee
+nwswnwnwnwnwnwenwnenwnwswnwwnw
+weeneweswwsenese
+neesenwneseeeeseseeswswnwwesese
+seseseseseeeweeesesewesesese
+sesenwnwsesesenwswsesesesesesese
+neneswnenenewnenenwneneneseneneneneneene
+wneenenwnenwnenenwneneeswnenw
+ewseswwnwsenewenwwnwnesenwsene
+seseseseseswswseseseeseswsesesenwswnenewse
+eneswswewneeeenweeeeeeenenw
+eseeseseeweneseesewseewseesenww
+wswswneswswswswnweenwswsenwwenwwwse
+nwwewewnenwnwenwswnweesenwwswww
+nenenwnwsenenwnwnwnewnwnwnwswnwnwnesenw
+wswseneeswwwnenenenwwsesenenwneesene
+esenwsesesenweeseeseee
+wnwnenenwnwnwnwnwsenwnwnenwnenwnenesene
+eswswnenwneeeeeeeeeeeene
+neneneneswneneneneneneneneseneeenwwne
+enenwnwswswnwewwnwswewnwewswesenw
+newsewwwwwwwwwwnwnwsewenwwnw
+enwwnwwwswswsesenesesesesenwswseene
+wnenwnwnewnewwwnwnwsewwwnwswnwnwsenw
+wnwseseswswseseseswseneswswswsenwswswsw
+eeweeeeeneeeseeesweeenee
+wswwwwewnwwwwswweswsw
+nesenwswsesweswsesesenwsesesew
+neneneeseneseweswnenenwswswnweeee
+eeeeneeeeenweeweeneeswese
+seswswseseseseswswswswnew
+wwnwwwswnwsenewneswswswewewww
+neneeeeeneeswswsweneeeneenwnew
+wnewwswwswenwnenwneewwsew
+neewenwewseeesenwesweeneswswnwse
+swnwnewnwnwnwnwsenwenwnwwwnwnwnwenwnwnw
+enenwwneseenewneeeswnewnwwneswee
+swneewneswneeswnenwseneneneenesew
+neenesenesewneneewwneneneneneewse
+eneewnwenenenwswsewsweeseneswswee
+wwnwwwewnwwwwnenwnwsewnwnwsewnw
+wwwnwseswnwwenwnwnwnwnwnwnwwnwwnw
+nwneseswseswswewwseseneneseseneseswnwsw
+swnwswnwwneenwweswnwnwwnwnwnwwenwnww
+neswsenewweswwswswsweswsw
+swneseeseenesenwswseeeseseesewee
+wseswwwwwnewnwwnwwwnwwwne
+eeneneeeneeeweeeene
+nwneeeeneswenwswsweenwseseneswew
+eswweeeeneeeeeneee
+nwseeseswneseesesesesesesesenwesenesesew
+senenwswsenesenwswswewsenee
+nwnwnwnwwnwwwenewnwnwnwsenwewwsese
+sesesewswneseswnenesesesese
+swswswwswswsweswswsweswswwwsweswnw
+seswweseneeeeseswsewwnwsweswsewnw
+wwwnenwwwsewwsewwnwwewwwww
+eenweeseewwseeseseeswnenewesesee
+eneswsenenenenewneenewneneneneneenene
+seswseseswwnesesenwseseesenwnesesenenew
+neswswswswseswwswswswswnwenwswswneswe
+sewseseswseswseseneenewswswwseseswnwse
+ewwwwnwwswswsewswsewsenwwneswnee
+wneweeneswwseenwswsenwsweenwneneee
+seseseneseneswswnwsewswnw
+wnesweeesweeeswenwenenenweese
+seeeweeneesenewneneeneeneneseenenw
+neswswnwnenwnwwswsenwnwseseenesenenwnesw
+neseswnwwseseneeswwneswswswwsweeswnw
+nwsenenwnesenwnwnwnwnwwneswnwnw
+wwewwwwwew
+wswwwwwwneswewnwswwwwswwnwesw
+seseseseseesesesenwsesesesw
+nwnenenwnwnenenwnwsenenwnwnwswnenenw
+seseseneneneeswnwnwsenwnwnwswswneswew
+wnwnenwnenwseeneswnwnwswnwwsenenw
+seswswswswseswswwswswswe
+nwneeseswsenwesesewsenwswwneseseesw
+seeeeeeenweeeeeesweenwsew
+swnwwseewnwwnwsenwnwnwnwnwwwnwwwwnw
+nwseneeswnwnenwswnwnene
+eneseneeswewwsewnwswnwswneesenese
+wwwwwswwneswwsesw
+seesesesewswnweswsewseseneswneswwsw
+wswwneswswnewswwseenwwswswwswswnwsw
+swswwswnwwswswseeeswwneswswsw
+nwnewewwsesewwwwwwwwswnwww
+nenwewswwwwwwsenwwnwse
+sesewsewseeesesene
+eenenwsweenweeeenwseseenwseseesw
+nwwnwwswswnwewsenwnwnwneeneswwwnwnw
+swnewwswswwnewswwswswseswswsenewww
+nwsenwsenwswsenweneenwsesenweewnwswswe
+seseenwseesewneeeseseseewseese
+eewenwnwswsewsene
+wnwnwsenwnwenenwnwswwwnwnwnwsewnwnwnwnw
+nwnwnwnwnwnwsenwnenwnenwnwnwnwnwwnwse
+nwswseswswswswseswsesweneseneswwsenwsw
+wsewnewnewseewwwwswswswwnwswsw
+wneseswnwwnwseseswneseswwnwwenewswsw
+swnewswwwewwswnwenwsewwwswswnww
+seseseseseseseseswsesesenw
+seseneswseswseswswwsesenesesesenwswsww
+ewnwnwsenenwnwwsewwseswnwwsenenwnw
+neenenenwnwnenwwnenenweneswnwnwnw
+wnwnwnwnwnewwwsewwsenwnwwnwnwnww
+nwneeswweeeeseenweeenweswswswse
+wwwswnwwwwnesewwewnewwwsew
+wwnwnwnwswwwwwwne
+nwnwnwnwnwnwnwnwewnw
+swwwswswswswswsweswnwswsweneweswswswsw
+nwnenwseneswsenwneenwnenenwnenwnwswnenwnw
+esewnwsesenwseeseeseseeseese
+senenwneeneneeneeenwnenenenweswneneswe
+sesweenweeeenesewwseesesesenese
+seseswswsesesesesenwseneswseseesesesese
+sweeseeeneeneenenwnwenesweenw
+nwnwnwwnenwnwnwnwnwesenwswsesenenwww
+wwwwwswnwwnewsew
+nenwnenenenenewsenwwene
+nesesenwnewseswswsewseseenenwsweswwswnw
+wnwsenwwwsenesewswnenwwwseneenwsww
+neswnwnwsenwnwwsesweewnesenwseseenew
+nwnewsewwwwnwnwww
+nwsenwwnwnwnwnwnwnwnenwsenwnwnwnwnwwnw
+eneeneeneeneneneswswnwneenenwnenwneswne
+wswnenenweswnwnenenwesweenenwnw
+wswnwswneswwseseswswwswwwswswnwsesene
+sewseneeseenwnweeesw
+seswnewenesewnewswwswneswswseswwne
+nenwnwnwwswnenenwnwnenenwnwnesenwnwenwnwsw
+wwswswwneswnewwwsewewwswwwswe
+newsweneseneenewnenewenewesenewe
+nenwneneswneneneswswneenenenenenenenenene
+seswnesesesesenwsesesewsesesesenwnwseswse
+sewseesesesesesenesesesenwswnwneseew
+eeeeeeeseswnwenenwsewsweeee
+wnwswsewewwwnwwswwwnwwwenwnew
+nwsweeeeeeeeeesenweseeeeesw
+nwnwwnwenwwnwnwnwnwnenwnwnwenwnwnwswnw
+nwswswswwewswswneseswswswswwswswnesww
+eswseseeweeeseeeneneseesesesee
+neneneeneswneenweneneeenenenenewsene
+wseeweneneweseeneeneneeeseenenene
+neesenwwsenenenewwweeneneweesw
+nesesenwneeneeesenwwswneswnwnwneww
+eesweweneeneeeeneesweeseenwe
+nenwnwnwswneneenenenwnenwnwnwswnesenenenew
+neswnesenwswseswesenwswseswewswsesww
+eseenweeseeeeeeesesesenwswee
+wseseeseseeesesee
+swsewnewwwnesesewwwwnwsewnenewnw
+nenenenenesenenenenewnwnesenenenwnw
+nwswswnewewnenwsewseswwsenenwesenwew
+enwnwnwwnwswwwnww
+eeeseeeesesenewseweeeeesene
+nwnwnewwwnwenwwswwnwwnwseesewse
+weenenenenenenenewnenesweneenesenw
+swenwsesenenwsewswnewsw
+senenwneseswwswnesenwnewnenenenenenenenw
+wwswwwswwnewwsewsw
+enewswwnewwwwwwnewnwseswswwwsw
diff --git a/2020/day24/main.go b/2020/day24/main.go
@@ -0,0 +1,135 @@
+package main
+
+import (
+	"bufio"
+	"fmt"
+	"os"
+	"regexp"
+)
+
+const (
+	E = iota
+	SE
+	SW
+	W
+	NW
+	NE
+	WHITE = 0
+	BLACK = 1
+)
+
+type pos [2]int
+
+func (this pos) move(dir int) pos {
+	other := pathToCoord([]int{dir})
+	return pos{this[0] + other[0], this[1] + other[1]}
+}
+
+func readInput(filename string) (res [][]int) {
+	file, _ := os.Open(filename)
+	defer file.Close()
+
+	scanner := bufio.NewScanner(file)
+	matcher := regexp.MustCompile(`e|se|sw|w|nw|ne`)
+	dirMap := map[string]int{
+		"e": E, "se": SE, "sw": SW, "w": W, "nw": NW, "ne": NE,
+	}
+	for scanner.Scan() {
+		curr := []int{}
+		for _, dir := range matcher.FindAllStringSubmatch(scanner.Text(), -1) {
+			curr = append(curr, dirMap[dir[0]])
+		}
+		res = append(res, curr)
+	}
+	return
+}
+
+func main() {
+	input := readInput("./input.txt")
+	// 382
+	fmt.Println(part1(input))
+	// 3964
+	fmt.Println(part2(input))
+}
+
+func pathToCoord(path []int) (coord pos) {
+	// Use E/W axis as x, NW/SE axis as y.
+	for _, dir := range path {
+		switch dir {
+		case E, NE:
+			coord[0] += 1
+		case W, SW:
+			coord[0] -= 1
+		}
+		switch dir {
+		case NW, NE:
+			coord[1] += 1
+		case SE, SW:
+			coord[1] -= 1
+		}
+	}
+	return
+}
+
+func part1(input [][]int) (blackCount int) {
+	tileColor := map[pos]int{}
+	for _, path := range input {
+		coord := pathToCoord(path)
+		tileColor[coord] = 1 - tileColor[coord]
+	}
+	for _, v := range tileColor {
+		if v == BLACK {
+			blackCount += 1
+		}
+	}
+	return
+}
+
+func flip(tileColor map[pos]int, steps int) map[pos]int {
+	// Same as day 17.
+	curr, next := tileColor, map[pos]int{}
+	for i := 0; i < steps; i++ {
+		// Update neighbor black count.
+		next = map[pos]int{}
+		for p, v := range curr {
+			next[p] = next[p] // ensure key exists
+			for _, dir := range []int{E, SE, SW, W, NW, NE} {
+				next[p.move(dir)] += v
+			}
+		}
+		// Update state.
+		for p, blackCount := range next {
+			switch curr[p] {
+			case BLACK:
+				if blackCount == 0 || blackCount > 2 {
+					next[p] = WHITE
+				} else {
+					next[p] = BLACK
+				}
+			case WHITE:
+				if blackCount == 2 {
+					next[p] = BLACK
+				} else {
+					next[p] = WHITE
+				}
+			}
+		}
+		curr = next
+	}
+	return curr
+}
+
+func part2(input [][]int) (blackCount int) {
+	tileColor := map[pos]int{}
+	for _, path := range input {
+		coord := pathToCoord(path)
+		tileColor[coord] = 1 - tileColor[coord]
+	}
+	tileColor = flip(tileColor, 100)
+	for _, v := range tileColor {
+		if v == BLACK {
+			blackCount += 1
+		}
+	}
+	return
+}