Unable to load image

rDrama Advent of Code Day 17: It's the weekend, why are you here? Edition

Summary for those just joining us:

Advent of Code is an annual Christmas themed coding challenge that runs from December 1st until christmas. Each day the coding problems get progressively harder. We have a leaderboard and pretty good turnout, so feel free to hop in at any time and show your stuff!

Whether you have a single line monstrosity or a beautiful phone book sized stack of OOP code, you can export it in a nice little image for sharing at https://carbon.vercel.app

What did you think about today's problem?

https://adventofcode.com/2023

Our Code is 2416137-393b284c (No need to share your profile, you have the option to join anonymously if you don't want us to see your github)

31
Jump in the discussion.

No email address required.

I think today's fucked my streak :( I just can't get it. Any help greatly appreciated, it's probably in the dijkstra method because I've debugged get_next_moves() and that returns only valid next steps.

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

Jump in the discussion.

No email address required.

You are only storing the position in visited, but you also need to store the direction you are moving in and the how often you have moved in that direction in the past.

Jump in the discussion.

No email address required.

I'm not really getting it. I am storing those things in to_visit but then you're right I don't care about them once I insert into visited. Why do I need it in visited? I only use visited to check if I've seen that coord yet.

Jump in the discussion.

No email address required.

Because it makes a difference on how you have visited the coord. Visiting the cord with steps_in_direction == 3 will have different outcome than visiting it with 0.

(also it seems like you are just checking if you have visited the coordinate, but I think you need to compare the current heat to the stored heat, and only reject if current heat > stored heat)

Jump in the discussion.

No email address required.

Thanks again, more for me to chew on. I think I need to learn Dijkstra and revisit this, I haven't done it since uni.

Jump in the discussion.

No email address required.

Thanks I'd been messing around with things like that earlier on but couldn't quite get it right. I'll give it another go.

Jump in the discussion.

No email address required.

Oh lol I see it


Give me your money and I'll annoy people with it :space: https://i.rdrama.net/images/16965516366194396.webp

Jump in the discussion.

No email address required.

I'll do anything please just let me know

Jump in the discussion.

No email address required.

that'd go against the spirit :marseyzeldalinktoon: of advent of code

:marseyshrug#:


Give me your money and I'll annoy people with it :space: https://i.rdrama.net/images/16965516366194396.webp

Jump in the discussion.

No email address required.

I think that collaboration and learning are key parts of Advent of Code. I think I've got it now anyway.

Jump in the discussion.

No email address required.

Good job :marseyexcited: it's always the little things


Give me your money and I'll annoy people with it :space: https://i.rdrama.net/images/16965516366194396.webp

Jump in the discussion.

No email address required.

Pls pls pls

Jump in the discussion.

No email address required.

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