view day19.txt @ 36:7197f31970ff

Day 25 part 1 instructions and partial solution
author IBBoard <dev@ibboard.co.uk>
date Thu, 18 Apr 2024 19:56:23 +0100
parents 5ba34a851816
children
line wrap: on
line source

--- Day 19: Aplenty ---

Objects have three values - x, m, a and s.

There are a number of workflows, which have a name and a set of rules.
Each rule specifies a condition and the name of the next step.
The first step is "in". The last steps are "A" (accepted) and "R" (rejected).
Once it matches a rule in a workflow, no further rules in the workflow are evaluated.

The input is a set of workflows, a blank line, and a set of objects.

px{a<2006:qkq,m>2090:A,rfg}
pv{a>1716:R,A}
lnx{m>1548:A,A}
rfg{s<537:gd,x>2440:R,A}
qs{s>3448:A,lnx}
qkq{x<1416:A,crn}
crn{x>2662:A,R}
in{s<1351:px,qqz}
qqz{s>2770:qs,m<1801:hdj,R}
gd{a>3333:R,R}
hdj{m>838:A,pv}

{x=787,m=2655,a=1222,s=2876}
{x=1679,m=44,a=2067,s=496}
{x=2036,m=264,a=79,s=2244}
{x=2461,m=1339,a=466,s=291}
{x=2127,m=1623,a=2188,s=1013}


These five parts would go:

    {x=787,m=2655,a=1222,s=2876}: in -> qqz -> qs -> lnx -> A
    {x=1679,m=44,a=2067,s=496}: in -> px -> rfg -> gd -> R
    {x=2036,m=264,a=79,s=2244}: in -> qqz -> hdj -> pv -> A
    {x=2461,m=1339,a=466,s=291}: in -> px -> qkq -> crn -> R
    {x=2127,m=1623,a=2188,s=1013}: in -> px -> rfg -> A

The sum of the sum of the x, m, a and s scores for the accepted parts is 19114.

--- Part Two ---

Each value can be in the range 1 to 4000. In the example input,
there are 167409079868000 combinations of values that would be accepted.
No information is given about what this means or how it is calculated.