Done day 24
authorNeil Smith <neil.git@njae.me.uk>
Sat, 9 Jan 2021 18:00:01 +0000 (18:00 +0000)
committerNeil Smith <neil.git@njae.me.uk>
Sat, 9 Jan 2021 18:00:01 +0000 (18:00 +0000)
advent24/package.yaml [new file with mode: 0644]
advent24/src/advent24.hs [new file with mode: 0644]
data/advent24.txt [new file with mode: 0644]
data/advent24a.txt [new file with mode: 0644]
problems/day24.html [new file with mode: 0644]
stack.yaml

diff --git a/advent24/package.yaml b/advent24/package.yaml
new file mode 100644 (file)
index 0000000..39c7ae7
--- /dev/null
@@ -0,0 +1,63 @@
+# This YAML file describes your package. Stack will automatically generate a
+# Cabal file when you run `stack build`. See the hpack website for help with
+# this file: <https://github.com/sol/hpack>.
+
+name: advent24
+synopsis: Advent of Code
+version: '0.0.1'
+
+default-extensions:
+- AllowAmbiguousTypes
+- ApplicativeDo
+- BangPatterns
+- BlockArguments
+- DataKinds
+- DeriveFoldable
+- DeriveFunctor
+- DeriveGeneric
+- DeriveTraversable
+- EmptyCase
+- FlexibleContexts
+- FlexibleInstances
+- FunctionalDependencies
+- GADTs
+- GeneralizedNewtypeDeriving
+- ImplicitParams
+- KindSignatures
+- LambdaCase
+- MonadComprehensions
+- MonoLocalBinds
+- MultiParamTypeClasses
+- MultiWayIf
+- NamedFieldPuns
+- NegativeLiterals
+- NumDecimals
+# - OverloadedLists
+- OverloadedStrings
+- PartialTypeSignatures
+- PatternGuards
+- PatternSynonyms
+- PolyKinds
+- RankNTypes
+- RecordWildCards
+- ScopedTypeVariables
+- TemplateHaskell
+- TransformListComp
+- TupleSections
+- TypeApplications
+- TypeFamilies
+- TypeInType
+- TypeOperators
+- ViewPatterns
+
+
+executables:
+  advent24:
+    main: advent24.hs
+    source-dirs: src
+    dependencies:
+    - base >= 2 && < 6
+    - containers
+    - linear
+    - text
+    - attoparsec
diff --git a/advent24/src/advent24.hs b/advent24/src/advent24.hs
new file mode 100644 (file)
index 0000000..d9bcc92
--- /dev/null
@@ -0,0 +1,100 @@
+-- import Debug.Trace
+
+import Data.Text (Text)
+-- import qualified Data.Text as T
+import qualified Data.Text.IO as TIO
+
+import Data.Attoparsec.Text hiding (take)
+-- import Data.Attoparsec.Combinator
+-- import Control.Applicative
+-- import Control.Applicative.Combinators
+
+import qualified Data.Set as S
+import Linear (V2(..), (^+^))
+-- import Data.Semigroup
+-- import Data.Monoid
+
+
+data Direction = NE | E | SE | SW | W | NW
+  deriving (Show, Eq, Enum, Bounded)
+
+type Tile = V2 Int -- x, y
+type Grid = S.Set Tile
+
+instance Semigroup Int where
+  (<>) = (+)
+
+instance Monoid Int where
+  mempty = 0
+
+main :: IO ()
+main = 
+    do text <- TIO.readFile "data/advent24.txt"
+       let walks = successfulParse text
+       let grid0 = foldr flipTile S.empty walks
+       print $ part1 grid0
+       print $ part2 grid0
+
+part1 grid0 = S.size grid0
+part2 grid0 = S.size $ (iterate update  grid0) !! 100
+
+delta :: Direction -> Tile
+delta NE = V2  1  0
+delta E  = V2  0  1
+delta SE = V2 -1  1
+delta SW = V2 -1  0
+delta W  = V2  0 -1
+delta NW = V2  1 -1
+
+
+flipTile :: Tile -> Grid -> Grid
+flipTile tile tiles 
+  | tile `S.member` tiles = S.delete tile tiles
+  | otherwise = S.insert tile tiles
+
+
+neighbourSpaces :: Tile -> Grid
+neighbourSpaces here = S.fromList $ map nbrSpace [minBound .. maxBound] -- [NE .. NW]
+  where nbrSpace d = here ^+^ (delta d)
+
+countOccupiedNeighbours :: Tile -> Grid -> Int
+countOccupiedNeighbours cell grid = 
+  S.size $ S.intersection grid $ neighbourSpaces cell
+
+tileBecomesWhite :: Grid -> Tile -> Bool
+tileBecomesWhite grid cell = black && ((nNbrs == 0) || (nNbrs > 2))
+  where black = cell `S.member` grid
+        nNbrs = countOccupiedNeighbours cell grid
+
+tileBecomesBlack :: Grid -> Tile -> Bool
+tileBecomesBlack grid cell = white && (nNbrs == 2)
+  where white = cell `S.notMember` grid
+        nNbrs = countOccupiedNeighbours cell grid
+
+update :: Grid -> Grid
+update grid = (grid `S.union` newBlacks) `S.difference` newWhites
+  where neighbours = (S.foldr mergeNeighbours S.empty grid) `S.difference` grid
+        mergeNeighbours cell acc = S.union acc $ neighbourSpaces cell
+        newWhites = S.filter (tileBecomesWhite grid) grid
+        newBlacks = S.filter (tileBecomesBlack grid) neighbours
+
+
+-- Parse the input file
+
+tilesP = tileP `sepBy` endOfLine
+tileP = foldMap delta <$> many1 stepP
+
+stepP = choice [neP, nwP, seP, swP, eP, wP]
+
+neP = "ne" *> pure NE
+nwP = "nw" *> pure NW
+seP = "se" *> pure SE
+swP = "sw" *> pure SW
+eP  = "e"  *> pure E
+wP  = "w"  *> pure W
+
+-- successfulParse :: Text -> [Tile]
+successfulParse input = 
+  case parseOnly tilesP input of
+    Left  _err -> [] -- TIO.putStr $ T.pack $ parseErrorPretty err
+    Right tiles -> tiles
diff --git a/data/advent24.txt b/data/advent24.txt
new file mode 100644 (file)
index 0000000..408fa7b
--- /dev/null
@@ -0,0 +1,592 @@
+wwwnwwswweswwwswwwwswwswwww
+swnwwsesenesenenwwnewwwwnwwnwwnw
+nenewnesenwnenenenenenene
+neeeeewneneneneeeeneeeeeee
+swwneswswseseneweseswnwnwseneswswsesenew
+eneneneswneeneeeneneeneenenenenene
+sesesweseseseenwseseseswsenwseswswswse
+eeeeeweneeee
+neesewweneewswneeneneseeeeeeee
+swsenwswswswswseswseswswswsweswswswswsw
+neswewswwsewwwnwsw
+seswsenenwswswswseseneseswswswseseswseswse
+sewweswneneeneneeeseseeseeneesww
+seswsesesesenwnwseseneseseseeseewseee
+nwnwnwwewnwwwwnwwwwww
+wnwwswwwwwswsewwwweswne
+swsesenenwnenwswseseneswseswe
+nwwenwwnwwwwwwswwsenwnewnwnwwne
+swwwwneswswwseswwswwneswwwswwew
+nwneswnenwnenenwenwnwnenenwsenenwnenenw
+neneneneneneeneneneneneeneneneenenwnesw
+nesewnenwwenwnwwseseeseseneneswwsw
+nwnwnwenwwnwnwneswnenenwnenenwnenenwnwne
+wnewswwwwswswwswwseswwswswswswsw
+nwweswnwswwwswswwnwwsewswswswenesw
+neswneneneneneewnene
+nwnwswnenwwnwnwnwnwnwnwwswswnewnenwwnw
+nenenenewewneneenenewsenewneenesee
+nwwnenwnenenenenwnenenwenwnenenenenene
+nwsenenenwnwnenenwnesenwnwnwnwnwne
+nwneseswwwwswsewwseswswswswswswnewsw
+wwwwnwswwwenewnwwwwswwnwww
+sesesesesesenwesesesesesesewsweseneseese
+eeneneweeeneeseeee
+wweswnwwnwnewnwwwswseenwwnwwnwnw
+neenenwneneseewnenwnwnwnenenwnesweswsw
+seswnwsesewwswwseswneswsweneeseswwe
+nenewnwnwnenenenewnwswenwwnesenesenwne
+nwenwneswswneeswsesewseww
+neneeneneewswneenwneneeneswnenenenee
+swseswseseswswseseseseswnwswseswswsw
+swneneneswwwneswwsewseswswswswwww
+nwneseswnwnwneswnewnwnwnenwnweseenwe
+wwwseeenwwnwnwnewnwnwwwnwnwnww
+sesesesesesesesewseseseseseseseesese
+swswwswseneeswnwwesewswswweneswsw
+wseewesenweneenewseneenenwswsee
+enewseeseesesesenesesewsewsesesesesee
+sewwwswswswwwwswwswswwwswneswsw
+nwnwnenwnwwwnwnenwnwnwnwnwswnwwsenwnw
+nwnwnwnenwnwnwnwneenenenew
+neeneenenenwswwseeneeesenw
+eseeeeseseweewseeseeeseeeee
+nwsewswseseseseneseswseswseseswe
+wwswswwswswnwwenwwwswswwseneew
+wwwwewwwwwweewswwwwwww
+swswswswswwswnweswwswswsweseswneswswsw
+nwewwsenweseeeswneneseneeweewnw
+nenewwnwsenwwwwswwsewewwenw
+nwwnenwnenwnwnwnenwnenwnwswnwnwnenwnenese
+seseneswseswswseswseswseswswseswseseswse
+eeeeeeweeeeeeeeeeswenwe
+eneswneneswnenenweneneneee
+nwswseeneneneeeeeeeeeeenenwenee
+swsenewwwwnwwwnewneeswwwnwwswnww
+eeeeeeeeeeeeeeweeeee
+eseeseseseeeseweneseeseeeeseese
+wwwwwwswwnwwwwnwswwnwwneewe
+eneseseeseseseneswneenwsewsenewswwswe
+senweeeeeeneseneeeseeswnwenwwe
+sewsweeneseswneswseswswwseswwswesenw
+wwwwwwwwswnwwwwwswwweww
+sewnwwwwwsewwwwnwnwenwenwnwswne
+eeeeeenweeseeeeee
+swsenwsweseswseswswswseswswsesesesesesese
+sewswwnwseswswswnweeenwsesesenenesesw
+nwnwseseewnenenewewwenwwnwsesenwne
+sesesenweseseseneswseseewseeseseneew
+swwswsewswsweswswswswseseswneswswswswnw
+swseesenwseseweseeseseeseseseeenwe
+wwnenwneenwnenenesenenenenwneweseswnwne
+nwnwnwnwnwnwnwnwnwsewnwnwnwnwnwsenwnenw
+seswsenwsesweswseseseseseswseswswsesene
+seswwseseseseseseseseswswsenesesesesese
+nwswswswswswneswswswswswsweswseswswswswsw
+wwwswwwwwwnesewnwnwsewwwwnwe
+seneneneeenewneeeeeenenweneswne
+seneenwseseseswsenwwneswswsese
+wswwswwwwwswnwsweenwswswwwswesw
+eeseseseeeseeesenweeesewswese
+nesewswswswnwswswswswwswsweswswswsww
+eneswswneeeeenweeeewnwenenwseesw
+seneswnwswenwnenenwwnew
+seenweweesewewseseeeeeneeew
+swnwnwnwnwnwnwenwwnwswenwnwnwnwnwnwnwnw
+enwswswswwseseseswsenwseseeseeseswwsw
+eeseseseswseseseswsenwwnwseseese
+neeeeneswnenenenenenenenenenwnenenee
+wnewwwwswewwwwwnwwswseswww
+neneneneneneneswneneneneneneneswnenewnee
+seeeseeseseseeseseeseswsenwseesesese
+swwsewswswwwwswswswsenewseswswnenw
+swneseseseswswseswswswseswwseseswswswse
+wswweswwnewwnwwww
+swswswsesewswswneswswswwsweneswswswsw
+wnwwnwwwweswnenw
+swseswsweswseswswswswswseswnwswseswswsese
+neenesewseneeesewewneneneenenw
+seneswseswswnwnwsweswswwswswswseswsenese
+nwenwswswwnwwnwnwnwnwsewsenwwwnwnwenw
+nenwnenenwnwnwnwnwewnwnwwnwwnwenee
+wneseeswwwswsewwwswnww
+nwnwnenwnwnenwnwnwneswnwwnwnwnwenwsenw
+neeeeneneneneeesweeeenenwswneneee
+senweseweseseseeseseseneseseeeswsese
+wseseeeneseseneeeeesewseeeweese
+seseseseeseseseseeeesewsesesenwsese
+wseeseenwseseneeseseeeseseeseeeese
+nwwesesesesenwnewwnwnesene
+swwneneeeeseeeeeswseenweeeee
+nenwseneneneeneeeee
+nwwsewwnewwwwwwwww
+neneseseenewewwnewnwnwesesenewsesee
+neswswswneswnenwwewswneswwswneseswsw
+seswswswseseseswseswnewseseswseswsw
+wneswseseseenwnewseeswswswnwswsesenw
+eneeweneneneeeneesenenenenenenenewse
+neswswwwwwwwwwswsew
+wneseswnewswwswew
+swnwwneswnwewswwswewnwswwwsenwse
+wnwnwwwwwnwnwsenwnwnwnwnwnwnwwsew
+senwswnwnwnenwswsewneseesenwnwwneenwsw
+nesesenenenenwnwneneswneneseenenenwnewnwnw
+nenesenwneneneneneneneswneenenenenenenene
+eweneesesesesewseeeseeeeeesesee
+eeneeweneeneneneneeswnenwneeeswne
+wswseswswnwswwswsweeseneswswseseswnw
+swenwwnwwsenwnwnewnwwenewwwesw
+senwseswswnewswswseswesweswswneswswse
+neseneneneeswneneenenenenenenenewnewne
+nesewsewwwewwwwwnwwnwnw
+swneswwwnwswnewneswwwwwsewwswsesw
+nenwwsewnwnwneswsesw
+nwnwnwnweseswnenwenwnwnwnwnwswnwnenwnwnw
+eswneneeneneneswnenenenenenewseneene
+nenwswwwswwwswsweswwwsweswswsww
+newneeeeneneneneneene
+wnwswewneeewseeseenwswwesenenew
+swswswseswswswswswswswswswswwswsweswsw
+eeeeenweesweeeeeenweeesw
+swswswswswswswswswswneswswswswswsw
+eeeeswwwneseeneeeeenweeswee
+wwwwwwwwwwwnenwwwwswwww
+swwswwnwswwwsewsww
+swnweesenwnwsenwswseswwweswswnw
+nesenenwnenwnwnenwnwnenenwnenwseenwwnewne
+nwsewwnwwnwwwwwwwwwnwnwnwww
+eneenewenewneneeeneneeswswneneee
+nenwnwnwnwwwnwsenwnwnwnwnwnwnwnwnwnwnwsw
+nwnwnwnwnenwnwwnwnwnwnwwnwnwswnwnwnwsenenw
+weseeeewneneseseeeeeseswesese
+swseseseseeesesesesesesesesenw
+nenwnesenwnewnenwnwnenenwnwnwnwnwnwnwnenw
+nwnwnwnwswnenwnwnwnenenwnwnwnenwnwne
+nwnenweswnenenwneenenewnenenenwnwnwnene
+seseeeeseeseseswesenwseseenw
+wnwnwnwnwneweswnwwwnwnenwnwwnwnwsew
+seneeswwwswneseseswwswseswswswswswswnw
+senwwnenwnwnwnenwnwnwnenwnwnwnwnwnwnenw
+swnwnwsenwnenwnwnenwnewnwseswnwnenwswne
+swswswswneswseswswswsw
+seseseswseseseseesesesenwesesesenwnwsese
+swswseswseswswswsesesesenesesenwsesesw
+wwswwwswwwwswwsewwnewnewwsww
+neswswwswseeswwswnenesesesesewswswsw
+wwwwwwwswwswseswnewsewswnewwww
+swwswswswwswwswwswswswswneswwwswsw
+wenwseeeseeseeeseeeseseseneese
+neneswnewswwwenwwwnwswsenwwwse
+wneweeseeseeeeweenwwewseene
+wswnwnweeswesweseenenwswwnenwwnwsenw
+sesenesesewseenwsesweeseewesesese
+eswseswsenwesenesesesesesewwswsese
+nenwwswewwwweseenwsenwwwwnwesw
+nwswweswswswswswswneswswwwwnweswse
+nwseswseeneseeweesesewneeseeseesene
+neeeswewewneseneswneneeneeneenenw
+eneneneeeeeweeeneneneeeneee
+seswseseswseswswseswseeswsesesewswsese
+nwnwnwewwwnwwwwnwwwe
+nenenenenwneneneneneswnenenenenenenenenee
+wneswneswswswswwswwewswswwwswsesewnw
+nenenwnenenesenwnwnenenwnenwwnwnenenenwnw
+eneeseswewnwseeswseewweeneswew
+ewenweeeeeesesesenweeseeee
+nwsenwnwnenwwnwnwnwenwnwnwewnwnwnewne
+wsweswswwswwswswwswswswswwswswnwwenw
+wwsewwswnwwneeswwwwnwwwswwww
+swsewswswswswswswswswswswswswswseseswne
+swnwnwnwnwewswswweeenwwnewnwnwnew
+seswswswswswneswswseswswswseswseswswswse
+nwwwnenwwwnwsewwenwwwswwwwnwww
+senwnwnwswneenweneseswnwneeswnwnweswne
+wseeeeeeeeenweeeneeeeee
+enweeweeenwenwseeneswseneneeeee
+nenweeeneseneeeseeeeenesenewwne
+nwnenenenwnenwswneswnenenwneneseene
+nwnwsenwswnwnwnwnwnwnenwnwwnwnenwnwnwnwnw
+ewnwsenwenwswneeseneneswnenewnenenese
+wnwswwwwnwsewwnwnewwwwswwneesese
+newwnwseswsenenwnwnwnenenw
+nwsesesenwsenwseseseeswseswswseswsesese
+sesesenwswseseswseseseeseswse
+nwneneenwwnenwswnenwswsenwnenwswneneenw
+enwswneneneseeeneeneneeewneswneee
+wnenenwneneneneneneseswnese
+neweeeneeeeeeeeeeeeeee
+wswswseswswnwswswswwswswwneswseswswnene
+swswseswwswseswsesweswseswseneseswnwswse
+wnenweseeesewseseswseseseweswneene
+enwswseseswswnwenesesewse
+neseneneneneeneenenenenenewswnenenenenene
+nwswsweeswseseswseswswnwwswseseswswsene
+eeneseeseneeseseesenwseseeswsewsese
+sesesenwesenwsweseseweneewseneneese
+sesewnwnwwnwnwwwnenwwwewsweww
+nwswwwewswwwnwwnwnwwnesewwwnww
+enwswnwnwsesewwweneswewwwnwneew
+wswswswneseswswwnwswswswswswnenwseswswse
+nwnwnwnenwnwnenwnwnwnwnwswnwnwenwnwnwnwnw
+nenenwnwnenenenenenesewnenenenenene
+nenwnwsewswwnwseenwnesenenwnenenwse
+wwwwwwwwwwwwwwswwwwwe
+seswswswswswnwsweswenwswswsewswswsw
+swswnwwswswwwswwneewwwswsw
+ewsewwnwnewwwwnwnwsewwwnwwnwse
+eseeseeseeeeeseeeneeeeseswe
+sweswswswswswswswwswswnwswseswswseswe
+wnenwswwnwnwnwnww
+sweeeseneseseneseseewseesesew
+seneeswneneenenwwswwseenwneneewene
+swswswswswsesweswswswswseseeseswswwswnw
+seeseeeesenwsweeseeeseese
+nwnwnwnwnwnwenwnwenwnwwnwnwnewenww
+wswswwswswweswswswwswnewsewswsw
+nwnwnwwnwnwnwnwwwwnwwnwnweenwnwnwwsw
+eneeeeneenenweneneneesweewesw
+nwsenwswnwnwnwnwnenenwnwnenenewnwnwnwnee
+swweswswswswneneswswswsesesewswsesesese
+swswsenwswswswswswnwneswsweswsewsesesew
+eneeeeeeneeneeneneeeeeswee
+swwseseswseswswnenwnwseswenenesenwswswsee
+seseseseseneswneseseswswsesewsesesesenesese
+swwswwswswwwswewwwwswswneswswsw
+esewwswwwwwwswwsewswswwnwnwswswne
+nwnwwnenwewnwnwnwnwswnwnwwswnwnewnw
+newswwswwswswswwseswwswnewwnwswswse
+wwwsenwnwwnwnwsenewwwwnwnwsenwnwwne
+seswwnwwwnwswsweenwwwwwee
+swswwswswswswswswswswswesenewswswswsw
+wwswswswswswswswswswswswswswesw
+wnwnwwwsewwwwnwwnwwnwwsenenwsew
+sewnwnenewwnesenwneeenwnwnenwnw
+nenwsenewnenwnenenenwnenenenenenenenenwne
+swswswswswswswswswswseneswswseswswswswsw
+neewnenenwnenenewnwnenesenenenwnenene
+swneeeneneeeeweneesenw
+eseewneeneeeseeswnewneeeeeeee
+senewsewneewswseswneswswseseswseswsw
+nenwnwenenenesweweswneneneneseeenene
+sesesesewsesewseseweseneswnesesesesese
+nenwnwnenenwnwnwswsenwnwneneswnenwsene
+swswswwneswswswneswswswswswswswwswwswsw
+wwwswsewwwnewnwwwwwwwnwew
+nwwnwwnwwnwnwwwwnwwwswwnewwew
+eenwneenweeswseneneneswesweneenenwe
+nwwnwenwewnwwnwnwswnwwnwnenwsewwesw
+seswswwswswnwswswswswswswsenenwseenenesw
+eeneswenweeneeneeeneneeneeee
+wwswswswwswswswwswswswswwwswswneswne
+nenwnwnenenwnwnenenwnenenwsenwnenenwnwnw
+nenenenenenenenenenewneneneneseneenenene
+eswnwswswsweswswswswswswswswswnwswswsw
+ewwwnwwnwswwnwwwwwnwnwnwwwnwenw
+swswseswswswswswseseseswseneswswsewswsw
+nwnenenwnwnenwnesenwnenwnenenenwnwnw
+sewnwwwwsewwwswwswwswswnwneswwsw
+swswswswswseswsenwsw
+wseswewneseswseseswneeseeesesewne
+seeewsweswswwswsewnenwneewewwnw
+seswenesesweseeesesenwweewnesenw
+swswswnwenwswsesewneswswneswseseeswswnw
+nwnwnwnwnwnwnwnwnwnwnwnwsenwnw
+nwewneneswneneneneenwswnwwesesenesenene
+eeneneweneneeneneeswnewenenene
+swwswswnwwsesweswwsweswnewwswwnw
+enenewneweneneneneeenenenenenenene
+eseesweseenweeeenweeseeeeeesw
+nwneeeneseseseseseseswsewsewsesewse
+nenewnweeeeswseswsesenw
+wnenenenenwnwneneswnwseeswsesenwnwnenenee
+eeeweeneeneseeesweeeneeenee
+swwnewswnewwnewseswsweswwswswwwsw
+senwnwseswwneswseseseswnwseseseseseseseswse
+nwnwneswnwenwnwnwnwnwnwnwnwnwnwnenenenw
+wnewnewnwswnwnwwwnwnwwnwwnwnwwsew
+eeeeeeseeenwneeeewesesweese
+swswseswswswseswswsweseswswneswswwnwsw
+senwnwsenwnwswenenenwwenwenwnewnwnwnw
+eweseswewseseneneseswneewseenwee
+sesesesenweseseseseseseseesesesesewsesw
+nwsenwnwnwnenwnwenwnww
+newwweeswwnewnwseswseenewwnwswnew
+wwsewwwwwwwwwwwwwwwnww
+wwenwswsweeenweeeeeseeswnwe
+nwswsewwnwwsenwswnwwnwsenewwnwenw
+seewseeeseeeeneeeeeeeeese
+enwswwnwwwnewwwsewnwewsenewswww
+senwnwswsenwnwnwnwnenenwnwswnenwnwnwnwsw
+swswwwswwnewwwwwwwewswseww
+seswseswseesewseseswseseneseseseswsese
+eneesenenwwnwseseeeenwneeenwswese
+nenwnesenenwnenenwnwnewnwnwnwnwnenenene
+swseseseswnwseswswseswswseswswswseswswsw
+newnwswwwnwwwwswnwnwewwwnwww
+neswsweeeeeenenenwswnenw
+senwwnwnwnwnwwnwwnwnwnwnwnwnwnwenwnwne
+nwnwnwnwnwnwnwnwnwnwnwnwnwnwwnwnwnwenw
+seswwsewswwesweseseswneswswnwswnesw
+nenwnwswswneneswneneneneeneswneneenenene
+neeswnenenwneneneneneneneene
+nwnwnwnwnwnwnwnwnwwwwnwnwenwwnwnwsenw
+wwwwseswwwwenwnwswswwwswswswwsw
+wwwwwwwwwwwwewwwewww
+swswswswseswswswswswwswswswneswneswswswswse
+nwnwenwswnwsenenwnwnwnwwnwnwnwnwnwswnw
+nwseeneneneneneneeeeseeenewnenenenew
+swneswneseseewesweneseenenewewnenene
+enesenwnwseeeenwwweeseeswnwese
+swswswswswneswswswswswswswswswswswswswsw
+eeeeeswnweeeneneneeneeeeenene
+eeseeseseswwnweeeeseseeseewsee
+nwnwnwnwwnwnwnwnwnwnwnwnenwnwsenwnenwnwnw
+enwwseseeeseseeeneseeeseenewsenwse
+swneseseswsesesesesesesesesesesesesesese
+eswewsenenwseeenwseenenenweswswnwew
+eseswesesesesesweseseswwsenwnesesesene
+nwnwswnwnwneswnwswnwsenwnwnwnwnwneeswnwe
+swseswwneswneswswseswwswswswwneswese
+wwswswwsenewwsewsenewnenewnesew
+wseswnwswseeenwneeeeneeswsesenwesee
+swesesenesweseewseeneseneseeseese
+swnenesesenwseeswwswnwwnenwneneseswse
+senwseswnewseeseweseseeeewewse
+seeswseswwswneswswseneswseswseswswsww
+wswwswswwwwswwswwswswwesw
+seseeseneseseseeeneseseesewseswseese
+seneswnwewswsesenwsenwneswswnewwswse
+sweseeseseseseseseesesesenwseswnwsesesese
+swnwswnewswswseswnewwnwswnewswswee
+seenewwsenwwwwwwwnewsenewwsww
+neswneswnenenenwswwenenwnenenenwenenwne
+neneeeneneneswnwneneneweneeneswnenenene
+seseseeseseenwsesee
+nenenenenwnenwnwnwnenenewsenenenenenene
+wwwweneneswnwesweweswnwsenwswnew
+swnenwnwwenewnwnwnweneneenewneswnee
+senesesewenwsesesesesesesesesesesesee
+wswwnewewswswnwsweweseswwswswne
+esweenweneneswnenene
+seseseseswseseswesesesesesesesesesewse
+nwnwnwnwseenwnwnwnwnwnwwwnwnwnwnwnwse
+neneeeenweneeneneeeeesenenenee
+esesenenewwseseseeeseeseneseeeesw
+ewwnewwnwwsenwwnwnwswnwnwnwnwnwnw
+nwnwnwnwnwnwnwnwnwnwswnwnwnwwenwnwnw
+swnwnenwswewnwwnwnw
+neneenesenewnenenewnenenenenenenenenene
+swswsewsesweseseswseneswnw
+seneneneneneswneneneeeeenwnenenenene
+nwnewsenwnwenwnenwnwnwenwnwnenwnwnww
+seneswnwsesesweswsenwnwweseneseswswse
+nwwsenwwwenwwsenwsewswnweenwsenww
+sewsesweeseneswnewseseseseswesenenesw
+seswseswseseswswseseswswseseswseswsene
+wwwwwwwwwwnwwewewwwwww
+seswnwseseseeseese
+swnweeeeeeeewseneeenweesww
+seswsesenwsesenwsewswswswseeseswseeswsese
+nwnwnwwnwnwwenwwwwwnwwnwwwnww
+nenenewseneneneneneneswnenenenwnewsenenenw
+nwwnwwnwnwnenwnwnwnwnwnwnwsewwnwnwnww
+eneeeeseswesewnenwnwseswsewnwwnenwse
+wenwsenwnwnenwnwwsewnwnwnwnwwsenwnww
+nwseenwwsenewwenwsewewneenwnwnwsw
+seneeswnwnesenwnwnwwesweswswnwnesenwnw
+wwswswswswswwswwswwswswswneswsw
+nwneneswenwswneneneswwsenwnesenenwnwnwnwne
+wwsesenenenwnewnenenenenwneneseeene
+nwsewwnwwesenwnwwnewnwwnwnwwwnw
+seneneewneeneeneeneneneeenenenenenew
+neswswsweswswswswnewneswwswwnwswwsw
+seseseeseeswnweesewsesesenewnwse
+senwwwwnwwwwnwwnwnwwwwwnww
+swswswwswswswswswswswneswswswswswswswsw
+neswswwenwnesenwneswnenwnenesewnenwnenene
+enenenenenenenesweenenenenwnwenese
+nwwwwwnwsewwwwwwwwwwwnww
+nenenesenenwneneneenenenenee
+nwenwnewswsewseewwwnwwe
+nwnwnwnwnwnwewnwnwnwnwswnwsenwwnenwnwnw
+swswswwswswswswswwswswnwswswswswesweswsw
+seseeseseseseseseswsesesenwsesenw
+wwwwnwsenwwwwwsenewnwnwwwww
+eeeeeneeeeeenesweeeeneene
+nwnenwnwnwwnewsewnesenwnwwwswwwww
+wswnwwewseswswwnenewwseswswnewse
+swseswswswswswswswswswswseswswswnwswnese
+nenwswwnenwseeswnwnweswwnwnwnwne
+nenwnwnenwnwwneneswnesenwnenwnwnenenwnw
+eeeeeeeeeeneweee
+swseseseseswswseeseswswswsenwswsesesw
+eneeeeeweeeeneeneeeeesee
+wseenwswswwswwwswweswseswnwnwwne
+seseswswsesenwseseseseseswweswswswsese
+nwwnwswwwnwwnwwewnewwsenwswnwnw
+swwswswswsweesenwswswswwneswwswwswnwe
+ewnwwwwseneswesewwenwwswswesw
+seseesesenwseswseseesewsesesesesesese
+swswswswneswneswswwswseswseseseseswswsw
+wswswswnwseswswswswwswswsweswswwsw
+nwnwnwnwnenwnenwswenwwswenenwnwnenwnw
+swswswswswswwseswswseseswswneswswswsese
+swswswwneswsweswwsewswwnwswwswswsww
+nenewneneneswnwnwene
+enweeeeeeeneeeeeswneeeswne
+enenwneeeeeneeneeneneeeeeswsw
+seseseseseswseseseseseseseseseenwsesesese
+nwnwswwwnwwsenwwenww
+eseseeseneseseseseseeeseewsesenwse
+seseseseseswseswsenwswseswsenw
+nwswseseseeseeenweeeseseeeeseee
+nwwwwwwwseeswswewnwswsw
+eseseseeseeseneseseeeeeweeesee
+seenwsewseeeseswswseseseesenweesesee
+neseweneenenenenenenenenwnenenenenwsw
+swseewneswswswswswseseswswswseswsenwsw
+swwneswswswswswswswseswwswswswswswwsw
+wswswwwswweswsweswwnwswswswwwwww
+wwwwwwswwswwnwwseswwewwwwnew
+nwnwnwnwwnwwweswnwnwnwnwnwnwnwwnwnw
+nenenenwseneswesewenewenenenwseenw
+eenweeeesweeeeeeeeeenee
+newswwnwswnenwwnwe
+senwseswseneeseeseseenwwsenesesesenesew
+eeeeeweeeeeeenweeseeseswsese
+neneneneneewneneneneneeswnenwneseeese
+enwswnwwnwneenwwnwnwnwnwnenwnwswnwnese
+swnwseenwwwseeseesesese
+seswwnenwwwnweeswenewnwswswnesee
+seswsweswseswswseeswnesewenwwnwsesesw
+nwsenwwnwnenenwwnwenesenwne
+neeenwneseewneswnwnwsewseswneswwse
+eseswsenesesweseeenwneesweneeee
+wnenwseweneeswswneswsesenwseswneesesw
+nwnenwsenenwnwnwseneswenwneswnwwnewne
+eeneeseeewsweew
+swwswnwswwwwswswwsewwwsewnesww
+eeeeneweseeeeseneseseseeeweese
+swnenwnewwswseneseswe
+swnwswsewswnwweseswswseseseseswneneswwe
+eneeseseswesenwsweseeeseneseesesese
+neenenwnwneseneswwneenenesw
+wwswwwwswwswwswswwwseswswwnew
+seseseseeeeeeseseneeseseeeesewse
+swseseswsweswnwseseseswseswseswseswnwsesw
+swneswswnwswswswewwswswseswswnewswse
+newnwsenwnwwwswwsewwneewwwsew
+weneneeeeeeeneseeeneswwnenenene
+wswswwswwwsewneswswwswswwwswswww
+neneneneneneneneeneneneseneneneneswnewnene
+sesesewsenwseswseneweseseneswswsenwse
+swnwnenwswnwesenwnwwnwsenwnwwewenw
+nwsewnenwnwnwnwnwnwnwwnwnesenwnwnwwwnw
+nesweswwswseneswswnwseenwnwswsweseswsw
+swneswwnenewseseeneenenenweneneesw
+eseseseeseseeeeseseenweeeswsese
+wwswwswswwswnwwwswwwwswswswswesw
+ewwnwswnwwwwwwwwwsewwwww
+seswnwseeswseswswseswsewswswswswsesesese
+eesenwseeeseseseeseseseseeswneee
+enwwwswwseswwswswwwwnwswwwswwww
+nwnwwnwwwnwnwsewnwnwnwnwnwnwnwnwwnw
+eeesesweseeseeeswneeesewenene
+eeeeeseweseeeeseeseee
+seseseseseeseseseeseseenwsenwseswswse
+nwsenwnwnwsenwnwsenenwnwwnwnenwnwnwnwnw
+senenesweneneswnwenenenenwnenenewwnenene
+neweeweeseeneeneeseseeneeeeenw
+wsenwnwnenwneeneseenwswsenene
+seeeneneeenweneneeeenee
+seeneeewseswnwseeseenwneseeeee
+wweswwnwseewseswewswswnwnenw
+nwwnwnwnwwwnwwnesewnwnewswseswne
+swswswswwswsenwswsww
+swwwsewwwwwwwnweewwnwwwe
+wsewwwwwwwswwnwwwswwwwww
+eeneeenweewsesweeeeneeneneenee
+neneneneneneneseneeneswneswnewnenenenene
+nenewsenwnewsewwseesewseneneswesee
+nwnwnwnwnwnwnwnwnwnwnwsewnenwnwnwwnwnwnw
+swwsewnenesewsweeseseswnesesesenwnese
+nwwwswwwwswnewwwwwwwwwsene
+sweeswswswnenwswswswnwswswswswswswwswsw
+esesenenewwseneneseneenwswnewwewww
+eseseneeseeseseseweseneeswesesese
+swswswswnenwsesweseseseswswseswseseswseswse
+eeeneneswneswneneeswswewenw
+sesewnesewseseseseseseseneesesesesesese
+seswswnesesesewswswseswneswnesesewswsese
+neesewnwwswneswwswsewswwnww
+eseewwseneswnewseneseseenwewswse
+nwwnwwnwnwwswseenwwnwnwwwnwnwnwnw
+wnwswwswwwnwwwnweneenwwswsewwnw
+nwseseseseneeseseeseseseswsesesesesesese
+nenwseeswnwwnwsenweswswswseese
+nenenwnenwnenenwnwnenenenwswnenwnenwnene
+enesenwswenwsesesenwswsenwsesesesenw
+neneeeeeneseeenenwnenenenenenenee
+sesesenewwseseseseswe
+swseswnwswsewswswnwneeswswseewseseswswse
+nwwnwnwnwwnwnwnwwnwwwnenwsewsewnwse
+swnewneswwwsewswwnenenenwwewswwsw
+swnwwnwsweeneeneeneeseseeneeeene
+eeseewneneeseeeeeeeeseeweee
+swswswswneseneswswwswwswseswseseneswswsw
+senwnwnenwnwwnwnwnwnwswnwnwnwenwswnwnw
+eeseseewseswneseneeenewsesesesenwse
+swseswswswswseseswswswseseswswnesw
+wwsenwnwsenwnenwnene
+swswswsweswswswwswswswnwnewswseswswww
+neneewswnenesweneesenwenewsweneseenw
+swswseswsweneswnwwsenwswswse
+nwsewsewwseneswnwwwswswwwwnwwww
+nesesewseeseseseeseswseesesesesenwse
+enenesenwsewswswnwseneeeeeeeeene
+nenweneesesweeneeeneeeeeneene
+wwswwwwwswswswnewswewwwenwsw
+wwwwwswnwsewswwsewwwswwwnwsww
+nesenenenewneneneneswswnenenenenenenenene
+eeneeweesweeeeeeenesweew
+swswswswseswseseneseswswseseswswseswsese
+newnwswswswsweseswsww
+nwswwnwsweswneswnwsenwnwsenenwneneee
+wnwewswneswswswneweswwswwswswnweswsw
+neswswswswswswwswewswswwswwswswswsw
+swsewswswseswswswswswsweseswswswswswsw
+nwwnwnwsewnenweswewnwwnwwswnwnww
+swenenenenenenenwneneneneeswneneneenenw
+wweswwwwswwswww
+enweneenesweneneeeneeneeneneene
+sesenewsenwseseseseswswswseseswswsenenesese
+nenewneeswnesenwswnwnenwenwnwnwnw
+neneswswnenenwswenwneeneseneneneewnww
+neneeeneneenweeneeneneswneenenene
+wwwwnwwwwwwswwwnwnwnewwww
+swswswswwwnewwswwwwswwswwwww
+nesweweneeeeeeeneweeeeene
+nwnwnewnwnwnwsewnwwnwwnwwnwwswwww
+wnwnwnwwwwswnwwwwnwew
+senwnwnenwnwnwnwnwwnwnwnenwnwnwnwnwnenw
+nwsewnenwnwnwnwnwnwnwnwnwwwnwwnwnwnwse
+neswneseeswsweswneneenweeene
+nenenwnwnwnenwnenenwnenwnwnwnweswnwsenwne
+nwnwnewwnwnwnwwwswwnwnwnwwwwnwnw
+seswwswswwswwswswswwswswwswswnwswsw
+nwnwnwwnwsenwsenwnwsenwenwwnw
+enwnwnwswnwsenwnwnenwnwenwsw
+seneseswwswwesesenwewneenweseeewnw
+swseesewewneesesenwnewseseseswsenw
+nenwnwnenwnenwneenwsenenwnwnwnwnwnwnwwne
+nwnwnenwnwnwwwnwwnwswnwnwwnwnwwww
+seseseseseseseseseseswswsesesesesenesenwse
+wswnwseseweeswseeneseeeneesesee
+senewsweswseseseswsesesesesesese
+neneneeeneeeneneeeenenweeneesw
+nwnenenenenenenenenwswnenenenenenenenw
+seseseseseseswsesewseseswsesenesw
+eseeeeseseseeseseseseseesesewene
+nwnwnwwnwnwnwnwnwwnwenwnwnwwnwwnwnw
+seswseseenwswswwsesenwseeeeneesenesese
+neeswseeseeeeeseeeeeeeseee
diff --git a/data/advent24a.txt b/data/advent24a.txt
new file mode 100644 (file)
index 0000000..55460d5
--- /dev/null
@@ -0,0 +1,20 @@
+sesenwnenenewseeswwswswwnenewsewsw
+neeenesenwnwwswnenewnwwsewnenwseswesw
+seswneswswsenwwnwse
+nwnwneseeswswnenewneswwnewseswneseene
+swweswneswnenwsewnwneneseenw
+eesenwseswswnenwswnwnwsewwnwsene
+sewnenenenesenwsewnenwwwse
+wenwwweseeeweswwwnwwe
+wsweesenenewnwwnwsenewsenwwsesesenwne
+neeswseenwwswnwswswnw
+nenwswwsewswnenenewsenwsenwnesesenew
+enewnwewneswsewnwswenweswnenwsenwsw
+sweneswneswneneenwnewenewwneswswnese
+swwesenesewenwneswnwwneseswwne
+enesenwswwswneneswsenwnewswseenwsese
+wnwnesenesenenwwnenwsewesewsesesew
+nenewswnwewswnenesenwnesewesw
+eneswnwswnwsenenwnwnwwseeswneewsenese
+neswnwewnwnwseenwseesewsenwsweewe
+wseweeenwnesenwwwswnew
\ No newline at end of file
diff --git a/problems/day24.html b/problems/day24.html
new file mode 100644 (file)
index 0000000..308e0c1
--- /dev/null
@@ -0,0 +1,183 @@
+<!DOCTYPE html>
+<html lang="en-us">
+<head>
+<meta charset="utf-8"/>
+<title>Day 24 - Advent of Code 2020</title>
+<!--[if lt IE 9]><script src="/static/html5.js"></script><![endif]-->
+<link href='//fonts.googleapis.com/css?family=Source+Code+Pro:300&subset=latin,latin-ext' rel='stylesheet' type='text/css'/>
+<link rel="stylesheet" type="text/css" href="/static/style.css?25"/>
+<link rel="stylesheet alternate" type="text/css" href="/static/highcontrast.css?0" title="High Contrast"/>
+<link rel="shortcut icon" href="/favicon.png"/>
+</head><!--
+
+
+
+
+Oh, hello!  Funny seeing you here.
+
+I appreciate your enthusiasm, but you aren't going to find much down here.
+There certainly aren't clues to any of the puzzles.  The best surprises don't
+even appear in the source until you unlock them for real.
+
+Please be careful with automated requests; I'm not a massive company, and I can
+only take so much traffic.  Please be considerate so that everyone gets to play.
+
+If you're curious about how Advent of Code works, it's running on some custom
+Perl code. Other than a few integrations (auth, analytics, social media), I
+built the whole thing myself, including the design, animations, prose, and all
+of the puzzles.
+
+The puzzles are most of the work; preparing a new calendar and a new set of
+puzzles each year takes all of my free time for 4-5 months. A lot of effort
+went into building this thing - I hope you're enjoying playing it as much as I
+enjoyed making it for you!
+
+If you'd like to hang out, I'm @ericwastl on Twitter.
+
+- Eric Wastl
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+-->
+<body>
+<header><div><h1 class="title-global"><a href="/">Advent of Code</a></h1><nav><ul><li><a href="/2020/about">[About]</a></li><li><a href="/2020/events">[Events]</a></li><li><a href="https://teespring.com/stores/advent-of-code" target="_blank">[Shop]</a></li><li><a href="/2020/settings">[Settings]</a></li><li><a href="/2020/auth/logout">[Log Out]</a></li></ul></nav><div class="user">Neil Smith <a href="/2020/support" class="supporter-badge" title="Advent of Code Supporter">(AoC++)</a> <span class="star-count">48*</span></div></div><div><h1 class="title-event">&nbsp;&nbsp;&nbsp;<span class="title-event-wrap">0xffff&amp;</span><a href="/2020">2020</a><span class="title-event-wrap"></span></h1><nav><ul><li><a href="/2020">[Calendar]</a></li><li><a href="/2020/support">[AoC++]</a></li><li><a href="/2020/sponsors">[Sponsors]</a></li><li><a href="/2020/leaderboard">[Leaderboard]</a></li><li><a href="/2020/stats">[Stats]</a></li></ul></nav></div></header>
+
+<div id="sidebar">
+<div id="sponsor"><div class="quiet">Our <a href="/2020/sponsors">sponsors</a> help make Advent of Code possible:</div><div class="sponsor"><a href="https://github.com/" target="_blank" onclick="if(ga)ga('send','event','sponsor','sidebar',this.href);" rel="noopener">GitHub</a> - We&apos;re hiring engineers to make GitHub fast. Interested? Email fast@github.com with details of exceptional performance work you&apos;ve done in the past.</div></div>
+</div><!--/sidebar-->
+
+<main>
+<script>window.addEventListener('click', function(e,s,r){if(e.target.nodeName==='CODE'&&e.detail===3){s=window.getSelection();s.removeAllRanges();r=document.createRange();r.selectNodeContents(e.target);s.addRange(r);}});</script>
+<article class="day-desc"><h2>--- Day 24: Lobby Layout ---</h2><p>Your raft makes it to the tropical island; it turns out that the small crab was an excellent navigator. You make your way to the resort.</p>
+<p>As you enter the lobby, you discover a small problem: the floor is being renovated. You can't even reach the check-in desk until they've finished installing the <em>new tile floor</em>.</p>
+<p>The tiles are all <em>hexagonal</em>; they need to be arranged in a <a href="https://en.wikipedia.org/wiki/Hexagonal_tiling">hex grid</a> with a very specific color pattern. Not in the mood to wait, you offer to help figure out the pattern.</p>
+<p>The tiles are all <em>white</em> on one side and <em>black</em> on the other. They start with the white side facing up. The lobby is large enough to fit whatever pattern might need to appear there.</p>
+<p>A member of the renovation crew gives you a <em>list of the tiles that need to be flipped over</em> (your puzzle input). Each line in the list identifies a single tile that needs to be flipped by giving a series of steps starting from a <em>reference tile</em> in the very center of the room. (Every line starts from the same reference tile.)</p>
+<p>Because the tiles are hexagonal, every tile has <em>six neighbors</em>: east, southeast, southwest, west, northwest, and northeast. These directions are given in your list, respectively, as <code>e</code>, <code>se</code>, <code>sw</code>, <code>w</code>, <code>nw</code>, and <code>ne</code>. A tile is identified by a series of these directions with <em>no delimiters</em>; for example, <code>esenee</code> identifies the tile you land on if you start at the reference tile and then move one tile east, one tile southeast, one tile northeast, and one tile east.</p>
+<p>Each time a tile is identified, it flips from white to black or from black to white. Tiles might be flipped more than once. For example, a line like <code>esew</code> flips a tile immediately adjacent to the reference tile, and a line like <code>nwwswee</code> flips the reference tile itself.</p>
+<p>Here is a larger example:</p>
+<pre><code>sesenwnenenewseeswwswswwnenewsewsw
+neeenesenwnwwswnenewnwwsewnenwseswesw
+seswneswswsenwwnwse
+nwnwneseeswswnenewneswwnewseswneseene
+swweswneswnenwsewnwneneseenw
+eesenwseswswnenwswnwnwsewwnwsene
+sewnenenenesenwsewnenwwwse
+wenwwweseeeweswwwnwwe
+wsweesenenewnwwnwsenewsenwwsesesenwne
+neeswseenwwswnwswswnw
+nenwswwsewswnenenewsenwsenwnesesenew
+enewnwewneswsewnwswenweswnenwsenwsw
+sweneswneswneneenwnewenewwneswswnese
+swwesenesewenwneswnwwneseswwne
+enesenwswwswneneswsenwnewswseenwsese
+wnwnesenesenenwwnenwsewesewsesesew
+nenewswnwewswnenesenwnesewesw
+eneswnwswnwsenenwnwnwwseeswneewsenese
+neswnwewnwnwseenwseesewsenwsweewe
+wseweeenwnesenwwwswnew
+</code></pre>
+<p>In the above example, 10 tiles are flipped once (to black), and 5 more are flipped twice (to black, then back to white). After all of these instructions have been followed, a total of <em><code>10</code></em> tiles are <em>black</em>.</p>
+<p>Go through the renovation crew's list and determine which tiles they need to flip. After all of the instructions have been followed, <em>how many tiles are left with the black side up?</em></p>
+</article>
+<p>Your puzzle answer was <code>538</code>.</p><article class="day-desc"><h2 id="part2">--- Part Two ---</h2><p>The tile floor in the lobby is meant to be a <span title="I need one of these!">living art exhibit</span>. Every day, the tiles are all flipped according to the following rules:</p>
+<ul>
+<li>Any <em>black</em> tile with <em>zero</em> or <em>more than 2</em> black tiles immediately adjacent to it is flipped to <em>white</em>.</li>
+<li>Any <em>white</em> tile with <em>exactly 2</em> black tiles immediately adjacent to it is flipped to <em>black</em>.</li>
+</ul>
+<p>Here, <em>tiles immediately adjacent</em> means the six tiles directly touching the tile in question.</p>
+<p>The rules are applied <em>simultaneously</em> to every tile; put another way, it is first determined which tiles need to be flipped, then they are all flipped at the same time.</p>
+<p>In the above example, the number of black tiles that are facing up after the given number of days has passed is as follows:</p>
+<pre><code>Day 1: 15
+Day 2: 12
+Day 3: 25
+Day 4: 14
+Day 5: 23
+Day 6: 28
+Day 7: 41
+Day 8: 37
+Day 9: 49
+Day 10: 37
+
+Day 20: 132
+Day 30: 259
+Day 40: 406
+Day 50: 566
+Day 60: 788
+Day 70: 1106
+Day 80: 1373
+Day 90: 1844
+Day 100: 2208
+</code></pre>
+<p>After executing this process a total of 100 times, there would be <em><code>2208</code></em> black tiles facing up.</p>
+<p><em>How many tiles will be black after 100 days?</em></p>
+</article>
+<p>Your puzzle answer was <code>4259</code>.</p><p class="day-success">Both parts of this puzzle are complete! They provide two gold stars: **</p>
+<p>At this point, you should <a href="/2020">return to your Advent calendar</a> and try another puzzle.</p>
+<p>If you still want to see it, you can <a href="24/input" target="_blank">get your puzzle input</a>.</p>
+<p>You can also <span class="share">[Share<span class="share-content">on
+  <a href="https://twitter.com/intent/tweet?text=I%27ve+completed+%22Lobby+Layout%22+%2D+Day+24+%2D+Advent+of+Code+2020&amp;url=https%3A%2F%2Fadventofcode%2Ecom%2F2020%2Fday%2F24&amp;related=ericwastl&amp;hashtags=AdventOfCode" target="_blank">Twitter</a>
+  <a href="javascript:void(0);" onclick="var mastodon_instance=prompt('Mastodon Instance / Server Name?'); if(typeof mastodon_instance==='string' && mastodon_instance.length){this.href='https://'+mastodon_instance+'/share?text=I%27ve+completed+%22Lobby+Layout%22+%2D+Day+24+%2D+Advent+of+Code+2020+%23AdventOfCode+https%3A%2F%2Fadventofcode%2Ecom%2F2020%2Fday%2F24'}else{return false;}" target="_blank">Mastodon</a
+></span>]</span> this puzzle.</p>
+</main>
+
+<!-- ga -->
+<script>
+(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
+(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
+m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
+})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
+ga('create', 'UA-69522494-1', 'auto');
+ga('set', 'anonymizeIp', true);
+ga('send', 'pageview');
+</script>
+<!-- /ga -->
+</body>
+</html>
\ No newline at end of file
index 021f4baef9964b8e70b2d185affdcc317e1d7e51..0c9524d62e5d90c30e204a7717f481a2d855df1e 100644 (file)
@@ -58,6 +58,7 @@ packages:
 - advent21
 - advent22
 - advent23
+- advent24
 
 # Dependency packages to be pulled from upstream that are not in the resolver.
 # These entries can reference officially published versions as well as