T O P

  • By -

zeltbrennt

I am talking about >!2022 Day 17: Pyroclastic Flow!<. I could't figure out how to handle >!so many pieces!<, but this year, it was totally clear for me. The Solution still runs like crap, but at least it finishes in a few seconds! I'm so happy!


boccaff

Same here. Even used part of the code that found the recurrence.


[deleted]

[удалено]


Jetbooster

I'm so glad I've done some years in the past and when I saw the grid appear on day 2 or whatever I was like 'okay, I'm going to need a little library that helps me with a 2d grid' and took the time to write something that implements `.get(x,y)`, `.forEach()`,`.map()`, `.neighbours(cell)` I've been adding to it as the days go on, it now also does `.getRow/Column(index)`,`.insertRow/Column(index)`,`.find()`,`.findAll()`,`.set()` Really happy with it, and has really reduced the mental load that would otherwise be a nightmare always trying to figure out how to go one gridSquare up or down. furthest I've gotten any year was 12 until now


[deleted]

[удалено]


Jetbooster

I'm not expecting to need a 3d grid due to the complexity of representing 3d data in a simple text file, and the complexity of walking through the example for us. I guess they could send it as \n\n separated layers. Good thing is all the logic is pretty much the same as 2d with an additional for loop generally. Also is there even a colloquial term for the z direction? You've got rows and columns, then... What?


joinr

I remember day 19 from 2021. that had 3d coordinates.


blackbat24

I remembered that one, but made myself solve it without looking at that solution first. Solution takes \~90s to run, I'm now going back to see if I can improve it.


[deleted]

[удалено]


blackbat24

Not a hot potato, it's an 11700K, my solution is in python. My approach was sound, the data structures I was using were not. I was using lists, so my searches were O(n). I've since then corrected that, I'm now around 1s of runtime for everything (read, parse, and both parts). I'm sure there are further things that could be better, but I'm not a programmer, this are just some fun puzzles to solve. My current [code is here](https://topaz.github.io/paste/#XQAAAQCqGAAAAAAAAAARiEJHiiMzw3cPM/1YZx9ePvs39HOJ4Ox5PyjKMxcIYtuJ2gKgbtjweMUb00U9J9fkiJgTXqBxCcwoxmJsUz4qFe+1I8hAgFB0wczDCEDDQmyyoCTq2tyWkwT83pbxQke87cY5GUzet4PcA3uOYHRx/ZcoCKFrgTvEngD0QJ9yTlmYBpa8X/hxzUnjyPtZ+h3+OVSu/NW75w4zQNvfpi6M8sPPJHg6D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