Code for the Advent of Code event
aoc advent-of-code
at main 10 lines 303 B view raw
1import parse, find_match from require 'mfcsam' 2 3for line in io.lines 'input.txt', '*l' do parse line 4 5wanted = 6 children: 3, cats: 7, samoyeds: 2, pomeranians: 3, akitas: 0 7 vizslas: 0, goldfish: 5, trees: 3, cars: 2, perfumes: 1 8 9print find_match wanted, (a, b) -> a == b 10print find_match wanted