Function aoc::year2022::day11::play

source ยท
fn play(
    monkeys: &[Monkey],
    max_rounds: u32,
    adjust: impl Fn(u64) -> u64,
    pair: (usize, u64),
) -> [u64; 8]
Expand description

Play an arbitrary number of rounds for a single item.

The logic to adjust the worry level is passed via a closure so that we can re-use the bulk of the same logic between part 1 and 2.