Advent of Code 2023 - Day 10

This is a thread to discuss Day 10

It is VERY important NOT to write any public spoilers :slight_smile:
ALWAYS keep spoiler stuff hidden inside one of these


This text will be hidden

which you can obtain by clicking on the gear icon


Good luck :slight_smile:
FYI one of the features of Advent of Code is that we all get given different inputs so our answers will be different.
The examples are all the same but each of us gets different inputs for us to solve

Phew - eventually got a working version (very industrial :slight_smile: ) for Part 1

I might need a bit of a rest before attempting Part 2

I've not managed to come up with a method to do this so going to pass on it

I finally got around to doing this (which I really wanted to because it could involve drawing).

Part 1

And of course here's my path in a visual form.

My idea for this one was to define the list of possible pipe pieces (characters) with their directions, then have some code to find the path. The real tough part was getting it to actually work. Once I got it to work, I added the visual representation because I had been planning on adding it. I feel like the drawing alse gives me an excuse for it to run slowly (it is cool to watch it draw the path).

I love the challenges that are structured to allow you to add some visual flare with drawing the solution, instead of just relying on numbers. For example, 2022 day 9 could be drawn, but 2022 day 10 had you actually create an image, which you had to manually type in the solution shown in the image (it had you draw a crt screen).

Part 2

For part 2, I'm actually thinking of using a flood fill algorithm to find the area of the path. I may even be able to have it run synchronously with recursion to make it run faster.

Re Part 2

I thought of doing that but then I realised that some parts that are "outside" wouldn't be reachable by a flood fill.

I used the flood fill for the majority of the outside and then couldn't come up with anything to identify the remaining ones