Function advent_of_code_2021::day_4::parse_card[−][src]

fn parse_card(input: &str) -> BingoCard
Expand description

This takes a string with 5 lines, each with 5 space-separated numbers, representing a 5 x 5 bingo card. A regex is used to split the numbers on a line as single digit numbers cause there to be two spaces prefixing those numbers. Iterator::enumerate is used to track the current co-ordinates for building the map of unmarked numbers. The row and column arrays are initialised to 0s as no numbers have yet been marked.