xfix

xfix

Note: This topic is to talk about Day 17 of the Advent of Code 2019 .

There is a private leaderboard for elixirforum members. You can join it by following this link and entering the following code:

39276-eeb74f9a

Showing Posts 1 to 10

xfix

xfix OP

Hardcoded part 2 solution, oh well. It’s much easier to solve this manually than to write code that does it.

cblavier

cblavier

Can’t figure out why my part1 output is wrong :exploding_head:

Can you tell me what is your part1 result for my puzzle input? puzzle17.txt · GitHub

I suspect a bug in my intcode VM … :frowning_face:

xfix

xfix OP

Giving a hint, just in case you have the same bug as I had in my interpreter (and took a while to figure out). Specifically I constructed the output by doing [x | xs]. This however meant the output was reversed, but as it happens, this wasn’t really an issue until Day 17 part 1 (seriously, I only realized the issue now, as it happens, no previous tasks cared about whether the output was reversed or not).

If you have two newlines at the start of an output, that’s the issue. Those should be at end, not at the start.

cblavier

cblavier

:sob:

(thanks, it was indeed the issue !!!)

jenarvaezg

jenarvaezg

My solution for day 17.

When I did part 1, I expected to have to move the robot from start to finish for part 2, but the question was not what I expected. I calculated the movements by hand and pushed the data manually.

mexicat

mexicat

Thank you so much, I couldn’t figure out why the tests were working but the puzzle input was not!

bjorng

bjorng

Erlang Core Team

Here is my solution.

For part 2 I wrote a path finder function. (It would probably been faster to read out the path manually from printout in part 1, but what’s the fun in that?) My first attempt produced a too long path that I could not fit in the robot’s limited program space. I had to adjust the path finder to always going straight if possible so to avoid unnecessary turns. That shortened the path so I that could fit in the robot’s program memory.

If I hadn’t already been spending so much time on this puzzle, it would have been function to try to automatically split the path into the different parts of the robot’s program memory. I decided to split the path manually.

bjorng

bjorng

Erlang Core Team

I couldn’t resist the temptation to add an automatic splitter of the robot program.

Here is the updated code and here is the splitting code.

sb8244

sb8244

Author of Real-Time Phoenix

That’s impressive! Great work on doing the actual automated solution here.

I don’t think I did anything special—it’s a pretty standard solution. I was a bit frustrated because I knew the right path to do when only 25 people had solved both parts. But I had flipped my graph around (r, c iteration instead of c, r) and it completely changed my result. So I spent about 3 hours on it in the end. Once I realized the inversion mistake, I had the answer in about 10 minutes :frowning:

mortalisk

mortalisk

My solution

I also created an automated solution after first doing it manually. Manually was definitely faster :stuck_out_tongue:

Where Next? Top

Trending in Challenges Top

Other Trending Topics Top

dominicletz
Hey there, I haven’t seen a list of useful Elixir specific skills for the popular AI tools yet so I’m starting one here with my first. ...
New
mudasobwa
I fully migrated to my own harness from Anthropic/Gemini and I think it’s time to share it. Welcome DSH, the DeepSeek Harness, fully writ...
New
KristerV
Hey. Is there anyone here who creates agents in their apps? Not talking about using agents, but creating them. I’m finding it pretty diff...
New
jimsynz
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
webofbits
With AI doing more of the implementation work, I’ve been wondering how much coding I should deliberately keep doing myself. My main conc...
#ai
New
OndrejValenta
(I just needed to vent somewhere and LinkedIn is full of hope, or hype, I’m not sure which exactly) AI dream has many faces, but general...
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews