#2023 Day 10

58 messages · Page 1 of 1 (latest)

smoky spear
smoky spear
#

the brainfuck using nsew

smoky spear
rocky warren
#

Ugh, i struggled so hard on p2 dead

#

I eventually decided ||there is an easy mathematical way to determine when a node is looped or not, but it took me so long to figure out the actual method||

drowsy crane
#

I fucked up part 1 for so long

#

And then I essentially had to google how to do p2, I had no idea

warm salmon
#

I did too. The part 2 search. ||I knew there was a way from earlier AoC and my studies but needed a refresh of memories||

crude sparrow
#

i really like my p1... but p2 is... What

crude sparrow
#

|| flood fill is necessary but not sufficient||

rich folio
#

someone proposed ||shoelace formula|| in my comment section

#

seems interesting but I'm not sure how exactly to get it to work

#

I just used ||horizontal sweep toggling inside-ness each time you cross a vertical edge|| which is a trick I learned in a uni class :P

warm salmon
rich folio
#

||yep; I did it with a parity flag but I think you can also just regex and delete L-*J and F-*7 lmao||

warm salmon
#

||I also used a flag for it||

crude sparrow
#

i hate this, i hate everything about this

warm salmon
#

Why, it’s a nice task with actual applications of theoretical algorithms.

crude sparrow
#

cuz i'm too dumb

#

|| shoelace || doesn't work and my || counting traversals approach || is scuffed as heck and doesn't do what it should, so now i redid it and i'm blanking hard

manic junco
#

i did it using ||flood fill||

crude sparrow
#

i don't see the issue sadBOYE

#

based on that idea, which i think SHOULD work?

warm salmon
crude sparrow
#

ouu

#

no, wait, || that should be set union, if i'm not tripping and include the loop itselflen(outcoords | set(lace)) ||

warm salmon
#

||ah true… and what would your algorithm say is a . at the far left of the field: inside or outside?||

crude sparrow
#

oh no

#

|| i start with inside true kek that sure isn't right||

#

well, -44 aint right either

#

|| prob means i subtract the thing twice now... but without that it's 3 instead of 4 - AAAAH off by 1 error 😢 ||

#

ooooh i might have it

#

i don't have it

#

OMG

crude sparrow
drowsy crane
#

Yeah someone dropped that spoiler on me

#

👀 they know who

crude sparrow
#

apart from this bs...

#

but apparently py does not have jump labels

#

but thanks to neutrino's introduction to || zip(a, a[1:])|| the other day - might've been yesterday, that || shoelace || looks mighty nice, imo

drowsy crane
#

I do like how neatly pythons core functionality works

#

The basics are very clean

crude sparrow
#

ngl, really did not like python until trying a bit more seriously at aoc with it
and the core things it offers just work so darn well

drowsy crane
#

I love what you can do with array indexing alone

crude sparrow
#

glad js finally has #at but it's just not as good sadBOYE

rich folio
#

I think I prefer JS for production stuff

#

or that's just because of familiarity

#

but for AoC python is just way too nice

drowsy crane
#

JS's ecosystem is just too good

#

npm everything

upper skiff
#

That’s a crawl move

pastel plinth
#

Just catching up after the weekend, but part 2 was a tough one to crack

#

In the end, my eureka moment was using a script to draw the traversed path using Unicode block symbols, to cut out the white noise and just see the path in isolation

#

From there, the solution was only a few lines long, but it took me ages to get to that point