From 8777ff071f7bb37631baa7b6717ad29961e50911 Mon Sep 17 00:00:00 2001 From: "H.J" Date: Wed, 9 Oct 2024 11:36:55 -0400 Subject: sorting by language --- racket/aoc2022/day-19/day-19.rkt | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 racket/aoc2022/day-19/day-19.rkt (limited to 'racket/aoc2022/day-19/day-19.rkt') diff --git a/racket/aoc2022/day-19/day-19.rkt b/racket/aoc2022/day-19/day-19.rkt new file mode 100644 index 0000000..1400bf2 --- /dev/null +++ b/racket/aoc2022/day-19/day-19.rkt @@ -0,0 +1,11 @@ +#lang racket + +(require advent-of-code + threading) + +(struct blueprint (id ore clay obsidian geode)) + +(define (parse-line str) + (match (~> str (string-replace #px"[^\\d\\s]" "") string-split) + [(list id ore clay obsidian-ore obsidian-clay geode-ore geode-obsidian) + (blueprint id ore clay (cons obsidian-ore obsidian-clay) (cons geode-ore geode-obsidian))])) -- cgit v1.2.3