Unable to load image

rDrama Advent of Code Day 3: Gondola Grid

Here's my awful brute-forced C++ solution. Probably could've been done better but hey it works.

https://i.rdrama.net/images/1701590264996321.webp

____

What did you think about today's problem?

14
Jump in the discussion.

No email address required.

https://i.rdrama.net/images/17016042315402539.webp

Jump in the discussion.

No email address required.

are you in uni for comp sci quad?


Follower of Christ :marseyandjesus: Tech lover, IT Admin, heckin pupper lover and occasionally troll. I hold back feelings or opinions, right or wrong because I dislike conflict.

Jump in the discussion.

No email address required.

No, I already finished it.

Jump in the discussion.

No email address required.

are you planning to stay in hungary or do you think you'll be a codecel in the land of the free?


Follower of Christ :marseyandjesus: Tech lover, IT Admin, heckin pupper lover and occasionally troll. I hold back feelings or opinions, right or wrong because I dislike conflict.

Jump in the discussion.

No email address required.

idk maybe if things go bad I'll think of moving to another country, but most likely to the Nordics then, not the land of the free.

Jump in the discussion.

No email address required.

I wish you the best either way :@quadnarcapat:


Follower of Christ :marseyandjesus: Tech lover, IT Admin, heckin pupper lover and occasionally troll. I hold back feelings or opinions, right or wrong because I dislike conflict.

Jump in the discussion.

No email address required.

thank you

Jump in the discussion.

No email address required.

tripleposting my comment....

First a hint: my input parser was broken because I forgot that a number could end at the end of the line

Here's my solution, the two functions left off are an ugly parser which spit out sets containing tuples (symbol, i, j) and (value, i, range[j]) and to_search(i,j) spits out adjacent squares (I did skip 0,0 but just 1-indexed instead of checking -ves, OP using max(x-1, 0. is kewl). If I was smarter I would've used a map/dict somehow, which would've made .contains() viable which might've been more performant, but having to search by symbol for p2 would negate that probably. On the bright side I'm learning to use iterators over loops which might help my ongoing transition to Rust programmer.

https://i.rdrama.net/images/17015920751163921.webp

Jump in the discussion.

No email address required.

First a hint: my input parser was broken because I forgot that a number could end at the end of the line

same. that was annoying as to figure out.

Jump in the discussion.

No email address required.

going to kill myself honestly. this is the first time ive tried to write anything sober in as long as i can remember and i thought i could be clever by using sets and just wound up confusing myself, but it eventually "worked".

https://i.rdrama.net/images/17016064311056345.webp

i did make a neat picture while debugging though

https://i.rdrama.net/images/1701606432267906.webp

Jump in the discussion.

No email address required.

It's in moments like these that you miss dang.

Jump in the discussion.

No email address required.

:marseyheart:

Jump in the discussion.

No email address required.

lmaoo I don't think i can do pt 2 in shell

I am not the wizard I wish I was :tfwyougettrolled:

https://i.rdrama.net/images/17016553914148226.webp

Jump in the discussion.

No email address required.

:#marseyreindeer2:

Jump in the discussion.

No email address required.

Link copied to clipboard
Action successful!
Error, please refresh the page and try again.