Stream: roctoberfest

Topic: Day 7


view this post on Zulip Shritesh Bhattarai (Oct 05 2022 at 02:39):

I had to write my own Num.abs as it crashes the compiler but today was nice and easy: https://github.com/shritesh/advent/blob/main/2021/7.roc
Issue: https://github.com/roc-lang/roc/issues/4210

view this post on Zulip Brendan Hansknecht (Oct 08 2022 at 05:05):

Day 7 was not too hard, but I spent too much time trying to debug something that need like a single line of printf debugging for me to figure out. Can't wait until #4093 is fixed. Anyway, my code is here: https://github.com/bhansconnect/roc-aoc-2021/blob/trunk/day7/part2.roc

view this post on Zulip Ghislain (Oct 11 2022 at 10:49):

For part1, the solution is not to compute the median?

view this post on Zulip Ghislain (Oct 11 2022 at 14:53):

I didn't read well the instructions :face_palm:

view this post on Zulip Brendan Hansknecht (Oct 11 2022 at 14:54):

I guess that means it isn't median?

view this post on Zulip Ghislain (Oct 11 2022 at 14:56):

It is, but the result is not the median itself but the sum of all the move

view this post on Zulip Ghislain (Oct 11 2022 at 14:58):

I wrote 3 different algorithms to get the same result and be sure I was dumb at reading the instruction :sweat_smile:

view this post on Zulip Brendan Hansknecht (Oct 11 2022 at 15:04):

ah. makes sense

view this post on Zulip Ghislain (Oct 11 2022 at 15:35):

Here it is :octopus: https://github.com/ghigt/advent-of-code/blob/main/roc/day-7/part2.roc


Last updated: Jul 06 2025 at 12:14 UTC