sln_2017_09
Copyright(c) Eric Mertens 2017
LicenseISC
Maintaineremertens@gmail.com
Safe HaskellNone
LanguageHaskell2010

Main

Description

https://adventofcode.com/2017/day/9

Day 9 poses a problem of parsing a nested bracket structure.

Synopsis

Documentation

parseGroup Source #

Arguments

:: Int

group depth

-> ReadP (V2 Int)

group score, garbage count

Parse the group string format as defined in Day 9. Parse result is a vector containing the group score and garbage character count.

parseGarbage Source #

Arguments

:: ReadP Int

garbage count

Parse a angle-bracket bracketed region of characters and return the number of non-ignored, contained characters. Characters including and following a ! are ignored inside garbgae.

p :: ReadP (V2 Int) Source #

Starting parser named with a single letter to work with format.

main :: IO () Source #

Print solution for Day 9. Puzzle input can be overriden by command-line argument.

>>> :main
14212
6569