Stream: advent of code

Topic: 2023 Day 6


view this post on Zulip Johan Lindskogen (Dec 06 2023 at 06:57):

Feels like we got off easy today! https://github.com/lindskogen/advent-of-code-2023/blob/main/day06/main.roc

view this post on Zulip Oskar Hahn (Dec 06 2023 at 08:16):

I also have kind of a so solution. It gave me the stars, but I would not call it finished. https://github.com/ostcar/aoc2023/blob/main/days/day06.roc

Spoilers

view this post on Zulip Fabian Schmalzried (Dec 06 2023 at 10:01):

Here is my day 6. It does not work with the sugical linker, so I had to use the legacy linker. But at least roc was nice enpught to tell me to use it.

view this post on Zulip Artur Domurad (Dec 06 2023 at 11:24):

view this post on Zulip Ahmad Sattar (Dec 06 2023 at 18:33):

Seems others have run into the same things I have on this one. Here's mine :)
https://gist.github.com/thehabbos007/d257b30f61b5ea95d8a5a9bf20630ead

view this post on Zulip Axel (Dec 06 2023 at 18:35):

The advantage of the brute force approach is you get away with using Nat only :sweat_smile:.
I figured there is an analytical solution, but it was just too convenient not to do it :see_no_evil:

view this post on Zulip Oskar Hahn (Dec 06 2023 at 19:07):

Axel said:

The advantage of the brute force approach is you get away with using Nat only :sweat_smile:.
I figured there is an analytical solution, but it was just too convenient not to do it :see_no_evil:

How long did your part2 run? I didn't think, this would be even possible :smiley:

view this post on Zulip Pearce Keesling (Dec 06 2023 at 19:18):

I ended up just doing the math. There were too many off by one errors in my code so I just did the 4 numbers manually :sweat_smile:. Well I guess sorta manually, I plugged the giant math expression into wolfram alpha.

view this post on Zulip Ryan Bates (Dec 07 2023 at 06:22):

Here's my solution for day 6. https://github.com/ryanb/advent-2023-roc/blob/main/day06/main.roc

view this post on Zulip Ryan Bates (Dec 07 2023 at 06:25):

@Artur Domurad I ran into the same thing. I made an issue about this here: https://github.com/roc-lang/roc/issues/6212#issuecomment-1844229658

view this post on Zulip LoipesMas (Dec 07 2023 at 19:11):

Doing math in Roc is... not there yet :sweat_smile: I wanted so just solve the quadratic equation, and I did, but I couldn't get Num.ceiling or Num.round to work, so I had to use Python. It ended up being 85% Roc, 10% Python, 5% me. But I got the stars and that's what matters ;]

view this post on Zulip Fabian Schmalzried (Dec 07 2023 at 20:55):

I think Dec is not there yet. It's the new default. If you use any float, it works fine.

view this post on Zulip LoipesMas (Dec 07 2023 at 21:38):

I tried that before, but it didn't work. But now it seems to work, but only with legacy linker. Maybe I was more explicit with types now (annotating every intermediate variable)?

view this post on Zulip Ayaz Hafiz (Dec 08 2023 at 00:51):

My day 6 https://gist.github.com/ayazhafiz/f82db5c56a431d822fe8a98fd24181ca. I only half did the math

view this post on Zulip timotree (Dec 09 2023 at 23:38):

My day 6 https://github.com/timotree3/aoc2023/blob/main/roc/day6.roc.

Spoiler

view this post on Zulip timotree (Dec 09 2023 at 23:39):

Oh looks like Ayaz and I did pretty much the same half of the math

view this post on Zulip Isaac Van Doren (Dec 10 2023 at 21:33):

Here's my day 6 https://github.com/isaacvando/aoc/blob/main/2023/day6.roc

view this post on Zulip Jonas Schell (Feb 19 2024 at 23:44):

Once again, I brute forced my way through the problem. It only took 1.8 seconds. I also used the roc-parser package for the first time. I had a few problems at first, but once I worked them out it was really nice to use. :sparkles:
My solution: https://github.com/Ocupe/advent-of-code-2023/tree/main/day_06


Last updated: Jul 06 2025 at 12:14 UTC