Papey
This topic is about Day 20 of the Advent of Code 2020 .
Thanks to @egze, we have a private leaderboard:
https://adventofcode.com/2020/leaderboard/private/view/39276
The join code is:
39276-eeb74f9a
Trending in Challenges
Other Trending Topics
Hey, I’m Jesse and I’m the main contributor behind Dexter, a full-featured, lightning-fast Elixir LSP optimized for large codebases. It s...
New
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
ExRatatui lets you cook up rich terminal UIs in Elixir, powered by Rust’s ratatui via Rustler NIFs. Build interactive terminal applicatio...
New
Hello everyone. After busy few months I am happy to announce v0.1.0 of Emerge & Solve.
They are GUI (Emerge) and State management (S...
New
Corex is an accessible, unstyled UI component library for Phoenix that integrates Zag.js state machines using Vanilla JavaScript and Live...
New
Emily is an Elixir library that runs Nx computations on Apple’s MLX. Install it as the default Nx backend and Nx, defn, Axon, Nx.Serving,...
New
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #blog-post
- #phoenix_html
- #iex
- #graphql
- #ai
- #genstage
- #elixirconf-us
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #metaprogramming
- #security
- #hex










Showing Posts 1 to 10- Show Best Posts
- Show All Posts (oldest first)
- Show All Posts (newest first)
Papey
Just the part 1 for now.
I did not reconstruct the map, just looked at corners. It’s ugly and verbose but it works.
Now on part 2, but I already find the sea monster, it’s my function that finds corners
https://github.com/papey/aoc/commit/28227b000a7dbe2ddfc122c6e36a6d9f7d3f4167
code-shoily
I struggled with this one. The algorithm was in my head almost immediately, but I missed the case of “flip” in the code, so the
here is how I did it:
String.reversewas missinghttps://github.com/code-shoily/advent_of_code/blob/master/lib/2020/day_20.ex
code-shoily
lol now I am tempted to refactor my code to make my function look like a sea-monster.
lud
I did the same and achieved part 1 in a few minutes ..
But that was a trap! And now I have re-written part 1 to be the actual thing and be able to solve part 2. Still not there but I progress slowly but surely towards the goal. I wonder if people on the leaderboards solved part 2 in less than 10 minutes.
Papey
I spend too much time on it, i’m exhausted… Will try it later.
lud
I got is working this afternoon, and I’ve just cleaned the code a little bit.
Not very proud of this solution as it is messy and hard to read. But it completes in 15ms (not counting transforming the raw input into list of tiles (which are lists of lists of chars).
camilleryr
This one was a real struggle - and the code that produced the solution way more monstrous then the sea monsters it found… Struggled with lots of off by 1s and sill little bugs, but it was a real relief when part 2 ran.
Warning - here there be monsters…
https://github.com/camilleryr/advent20/blob/main/lib/day_20.ex
Hallski
I did a similar solution for part 1 hoping that the second part would take another direction. Unfortunately I continued down that path and was only looking at the edges by building up the operations that were needed to properly align them and then applying those to the matrixes. That left a lot of room for hard to debug issues though.
After I got to a point where the test data worked fine and the real input built a non-square map I decided to call it a night and take a break for a few days to see if I get the energy to come back and finish up the last couple of days during the holidays.
bjorng
I tried to leverage my corner-finding code from part 1 for part 2, but I didn’t make much progress. After sleeping on it I decided to start over with another approach for part 2. I spent most of the time getting the tile combining to work. After that, it was fairly easy to implement the search for the sea monster.
Here is my solution.
Papey
https://github.com/papey/aoc/commit/dc12a70b0b7100f60c613d4aba8f861d412f8c91
(I choose Ruby over Elixir mainly for dev speed and mutability for the backtrack algorithm)