This commit is contained in:
Aly 2018-12-02 21:51:15 -08:00
parent d07dd395e1
commit d90152d660
No known key found for this signature in database
GPG Key ID: 555B7346639DDAC3
1 changed files with 5 additions and 4 deletions

View File

@ -12,6 +12,7 @@ object Day03 extends Day {
def idParser[_: P]: P[Int] = P("#" ~ numParser)
def coordParser[_: P]: P[(Int, Int)] = P(numParser ~ "," ~ numParser)
def dimensParser[_: P]: P[(Int, Int)] = P(numParser ~ "x" ~ numParser)
def claimParser[_: P]: P[Claim] = P(idParser ~ "@" ~ coordParser ~ ":" ~ dimensParser).map {
case (id, coords, dimens) => Claim(id, coords, dimens)
}