Day04
Copyright(c) Eric Mertens 2021
LicenseISC
Maintaineremertens@gmail.com
Safe HaskellNone
LanguageHaskell2010

Main

Description

https://adventofcode.com/2021/day/4

Today we played Bingo and picked the first and last winning cards

Synopsis

Documentation

type Board = [[Int]] Source #

main :: IO () Source #

>>> :main
49686
26878

play :: [Int] -> [Board] -> [Int] Source #

Given the called numbers and initial boards return a list of winning scores in order of winning.

mark :: Int -> Board -> Board Source #

Mark off a called number on a board.

score :: Int -> Board -> Int Source #

Compute the final score for a board given the last call and unmarked numbers.

isWinner :: Board -> Bool Source #

Predicate for boards with a completed row or column