sb8244

sb8244

Author of Real-Time Phoenix

Advent of Code 2019 - Day 10

Note: This topic is to talk about Day 10 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

Most Liked

sb8244

sb8244

Author of Real-Time Phoenix

My solution is here. I actually documented the approach in pt1 / pt2 at the top. I won’t paste it here to avoid spoilers, it’s still early on the day.

ferd

ferd

Author of Property-Based Testing with PropEr, LYSE, & Erlang in Anger

High school math is needed, but I decided to avoid it for as long as I can. It takes about 2 hours to get the whole thing going (and I’ve had to spend my morning, lunch, and breaks on this!) but I end up with a fully functional solution for arbitrary-sized maps and positions. It ought to be fast enough, finding both the solution to part 1 and part 2 in under 100ms combined by doing some fancy filtering.

Source at https://gist.github.com/ferd/fa1618fbdbbfa0b4c7fb01a74d35463f

cblavier

cblavier

My solution : https://github.com/cblavier/advent/tree/master/lib/2019/day10

Wasted at least 1 hour this morning going totally wrong (I was only dealing with 8 different angles) :exploding_head:

And then I used the high school maths mentioned by @ferd :wink:

michallepicki

michallepicki

Interestingly, this can be solved without atan or any other float arithmetic. Here is a StackOverflow answer with an example algorithm for sorting points (the key is cross product of vectors).

aaronnamba

aaronnamba

Part 1 and Part 2 (most days, I clone my Part 1 solution before starting on Part 2, to preserve it as it was).

I kinda like how this one turned out. Less brute-force-y than most of my other solutions, but boy did it take a long time to get there.

Where Next?

Popular in Challenges Top

christhekeele
Continuation of Advent of Code 2022​:christmas_tree:, Day 1: Day 2! Leaderboard:
New
bjorng
Note: This topic is to talk about Day 25 of the Advent of Code 2019. There is a private leaderboard for elixirforum members. You can joi...
New
lud
At first I was scared but I found is a simple way to compute the sides. defmodule AdventOfCode.Solutions.Y24.Day12 do alias AdventOfCo...
New
bjorng
Note: This topic is to talk about Day 12 of the Advent of Code 2019. There is a private leaderboard for elixirforum members. You can joi...
New
bjorng
This topic is about Day 9 of the Advent of Code 2021 . We have a private leaderboard (shared with users of Erlang Forums): https://adve...
New
bjorng
Note: This topic is to talk about Day 23 of the Advent of Code. For general discussion about the Advent of Code 2018 and links to topics...
New
stevensonmt
Reasonably pleased with my solution. The bitstring packet problems are so well suited to Erlang/Elixir it’s almost not fair. defmodule D...
New
New
connorlay
Note by the Moderators: This topic is for general discussion about the Advent of Code 2018. To prevent people from being spoiled about s...
New
coen.bakker
Since I started using Elixir, I have benefited greatly from being able to study various open-source projects. The codebase of LiveBook, i...
New

Other popular topics Top

lastday4you
I wanted to check elixir version in phoenix because i found that my elixir is 1.5 but when i use Enum.chunk_by it said the function is un...
New
chrismccord
Phoenix 1.4.0 released Phoenix 1.4 is out! This release ships with exciting new features, most notably with HTTP2 support, improved deve...
688 30048 115
New
sergio
In Ruby, I can go: User.find_by(email: "foobar@email.com").update(email: "hello@email.com") How can I do something similar in Elixir? ...
New
srinivasu
How to handle excepions in elixir? Suppose i have A, B, C ,D, E modules. and each module has get() function. A.get() method will call th...
New
romenigld
I am trying to run a deploy with docker and I successfully runned with this command: docker build -t romenigld/blog-prod . but when I t...
New
quazar
How to set Jason to encode all fields in ecto schema, I don’t care about security and implementing only is taking long list of attributes...
New
chrismccord
As promised, the first release candidate of Phoenix 1.3.0 is out! This release focuses on code generators with improved project structure...
New
myronmarston
The Elixir Typespec docs show the following syntax for keyword lists in typespecs: # ... | [key: type] # keyword lis...
New
fayddelight
I tried installing elixir 1.11.2 erlang 23.3.4 via asdf in my zsh shell. Enabled the versions locally and globally. When I list them ...
New
jay1
Why is it that the mnesia database isn’t the most preferred database for use in Elixir/Phoenix?
New

We're in Beta

About us Mission Statement