Feels like we got off easy today! https://github.com/lindskogen/advent-of-code-2023/blob/main/day06/main.roc
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
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.
Seems others have run into the same things I have on this one. Here's mine :)
https://gist.github.com/thehabbos007/d257b30f61b5ea95d8a5a9bf20630ead
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:
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:
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.
Here's my solution for day 6. https://github.com/ryanb/advent-2023-roc/blob/main/day06/main.roc
@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
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 ;]
I think Dec is not there yet. It's the new default. If you use any float, it works fine.
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)?
My day 6 https://gist.github.com/ayazhafiz/f82db5c56a431d822fe8a98fd24181ca. I only half did the math
My day 6 https://github.com/timotree3/aoc2023/blob/main/roc/day6.roc.
Spoiler
Oh looks like Ayaz and I did pretty much the same half of the math
Here's my day 6 https://github.com/isaacvando/aoc/blob/main/2023/day6.roc
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