Advent-of-Code-2023/day10/notes.org

1.6 KiB

Notes

part 2.

how would i even try to check of 'in' or 'out' of the loop? i guess i could mark things while i go through the loop?

or, i could count manually?

i could change neighbors of the beast point. then do one more pass around, setting bool 'onMainPath' to true and then change all else to .

i guess i could then do one more pass, and mark as 'I' and 'O' closest line of .

another idea i don't really want to pursue - 'color fill from some corner' this is also painful due to pipes touching still need to let the 'O' filling in.

but yeah, if i make initial filling in of the I, then i could just fill in all . with I until nothing changes. and count I

sounds like a plan

allright, i found main path, display all not on main path as ' '

and the thing is a mess

i don't know how to select a point to mark as 'I'

but! if i select a point to mark as 'O' and then go around the main path, marking things on the side as 'O' then i would be able to fill in all which are neighbors of 'O' as 'O' and that would leave only 'I' to be counted

so.

how would i monitor consistent 'side' of the pipe during the walkhrough? if we go down - we color as 'O' one down. if we go angle - color two - one down and one to the right. and only color if it's not already on main path.

i suppose so

so a new method for initial pass of 'O'

well, i'll need access to the direction, in which the neighbor is taken? nooo. not direction, but the symbol. ok, this is easier

but i'll need to mutate the field

no, i do need direction.

ok, let's go lunch maybe, and maybe it will be a place with a power outlet as well