:partying_face: https://gitlab.com/JanCVanB/aoc-2024/-/blob/main/day-04/part-1/main.roc
I need to afk for a few hours... but figured I'd share my part 1 :smiley:
edit nvm part 2 was easy
https://github.com/lukewilliamboswell/aoc/blob/main/2024/04.roc
TIMING:
READING INPUT: <1ms
SOLVING PART 1: 49ms
SOLVING PART 2: 8ms
lol it seems rough from my approach
Here is mine: https://github.com/ostcar/aoc2024/blob/main/day04.roc
I used the array2d package. It uses backpassing, which results in my program to show warnings, that backpassing is deprecated.
Is there already a discussion, if warnings from dependent packages should be shown when compiling an application?
It's so fun to see people's different styles. Here is mine for today.
https://github.com/r-bar/advent24/blob/master/day04/p2.roc
I feel like I am starting to be able to pick out which roc code belongs to who from the people who have kept posting in here each day.
Dang, I finished writing my part 2 code a half hour ago but can't figure out why my non-example answer is wrong :/
Grrr. Oh well. Bedtime!
Is there already a discussion, if warnings from dependent packages should be shown when compiling an application?
They should not, there is already on issue for it #6700
Part 1 done. I'm glad I did it with support functions now that I see part 2 :D hopefully now it should only be a composing thing
https://github.com/thenikso/advent-of-code-2024-roc/blob/main/04.roc
Those of you done already are either a) From the Eastern Hemisphere, or b) Very committed :smiley:
https://github.com/RobinCamarasa/Advent-of-code/blob/master/2024/day04/RobinCamarasa/main.roc . Really enjoying doing AOC in roc. I am not only understanding roc better but also get inspiration on how to make a smarter use of error as value in general. And this is 100% thanks to the great naming of the standard library functions :smile:
Loved part 1, will do part 2 after work
https://gitlab.com/AsbjornOlling/aoc2024/-/blob/main/04/main.roc?ref_type=heads
Was going to do advent of code in python this year (all my friends are, and it's fun to compare)- but I got bored with it yesterday and switched back to Roc.
There sure is a lot of new stuff since I used Roc for aoc last year!
I managed to do todays without faffing with results too much, but I'd like to mess around with the ? operator soon.
The Array2D.subarray
function sure was useful for part 2 today. It sucks with the backpassing deprecation warnings though. Maybe someone should try making a PR :thinking:
Couldn't wait. Was able to do part 2 over lunch:
https://github.com/gamebox/aoc-2024/blob/main/day4/puzzle1/main.roc
https://github.com/gamebox/aoc-2024/blob/main/day4/puzzle2/main.roc
Very fun exercise.
It sucks with the backpassing deprecation warnings though. Maybe someone should try making a PR
I fixed it, I can make a PR
@Elias Mulhall https://github.com/mulias/roc-array2d/pull/9
Okey dokey, https://github.com/mulias/roc-array2d/releases/tag/v0.3.1 should be warning free, and I updated the examples to run with roc nightly!
https://github.com/isaacvando/aoc/blob/main/2024/4.roc
https://github.com/faldor20/aoc-template/blob/purity-inference/examples/2024/04.roc FInally got mine done too.
I was super happy about part 1.
part 2 I just kind of threw together :sweat_smile:
@Anthony Bullard asked for a recording of me using the Roc agent, so here it is:
aoc-2024-4-2024.mkv
I did not have to make any changes to the prompt so it was not very eventful :p
The sonnet 3.5 servers did get overloaded, so I switched to haiku but it made a copy paste error, later I was just able to switch back to sonnet. The bottom line of my terminal also got cut off, sorry about that.
Claude's solution:
main_claude.roc
Out of my own curiosity, can you have it do day nine and measure the perf?
Yeah totally :) can I just use Luke's default aoc-template measurement?
Also, should I measure with or without --optimize
?
yes and with optimize
Last updated: Jul 06 2025 at 12:14 UTC