view day21.txt @ 30:6de4f4d5404d

Implement Day 21 "possible spaces in a maze" Part 2 needs something like "find the repeats and lowest common multiple" that I'm not bothering with
author IBBoard <dev@ibboard.co.uk>
date Wed, 03 Jan 2024 12:01:18 +0000
parents
children
line wrap: on
line source

--- Day 21: Step Counter ---

You are in a maze. `S` is your starting position. `.` is open. `#` is blocked. How many spaces can you get to in N steps?

e.g. for this map:

...........
.....###.#.
.###.##..#.
..#.#...#..
....#.#....
.##..S####.
.##..#...#.
.......##..
.##.#.####.
.##..##.##.
...........

You can be in any of 16 spaces after 6 steps.

...........
.....###.#.
.###.##.O#.
.O#O#O.O#..
O.O.#.#.O..
.##O.O####.
.##.O#O..#.
.O.O.O.##..
.##.#.####.
.##O.##.##.
...........

How many spaces are there after 64 steps?

-- Part 2 --

The map tiles infinitely and you need to take 26501365 steps. How many spaces can you reach now? And does anyone care?