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?
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)
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 debuggedget_next_moves()
and that returns only valid next steps.Jump in the discussion.
No email address required.
Oh lol I see it
Jump in the discussion.
No email address required.
Pls pls pls
Jump in the discussion.
No email address required.
More options
Context
I'll do anything please just let me know
Jump in the discussion.
No email address required.
that'd go against the spirit
of advent of code
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
it's always the little things
Jump in the discussion.
No email address required.
More options
Context
More options
Context
More options
Context
More options
Context
More options
Context
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 intovisited
. Why do I need it invisited
? I only usevisited
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.
More options
Context
More options
Context
More options
Context
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.
More options
Context
More options
Context
More options
Context