License | MIT |
---|---|
Maintainer | @tylerjl |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
Solutions to the 2023 day 02 set of problems for adventofcode.com.
Synopsis
- data Color
- type Bag = Map Color Int
- type Games = IntMap Bag
- part2A :: Text -> Int
- maxColors :: [(Color, Int)] -> Bag -> Bool
- part2B :: Text -> Int
- maxColor :: Color -> Int -> Bag -> Bool
- parseRounds :: Text -> Games
- parseGames :: Parser Games
- parseGame :: Parser (Int, Bag)
- parseBags :: Parser Bag
- parseBag :: Parser Bag
- parseColorCount :: Parser (Color, Int)
- parseColor :: Parser Color
Documentation
maxColors :: [(Color, Int)] -> Bag -> Bool #
Take a list of color and shown time and determine whether the bag meets the criteria.
parseRounds :: Text -> Games #
Parse the Game
structure from an input Text
.
parseGames :: Parser Games #
parseColorCount :: Parser (Color, Int) #
parseColor :: Parser Color #