Stream: advent of code

Topic: 2023 Day 11


view this post on Zulip Fabian Schmalzried (Dec 11 2023 at 08:55):

https://github.com/FabHof/aoc-2023/blob/main/day11/main.roc

I had the right Idea for part 1 that made part 2 very easy to add. Generally I think it was easier than yesterday.

view this post on Zulip timotree (Dec 11 2023 at 12:37):

https://github.com/timotree3/aoc2023/blob/main/roc/day11.roc

Difficulty

view this post on Zulip Oskar Hahn (Dec 11 2023 at 13:38):

https://github.com/ostcar/aoc2023/blob/main/days/day11.roc

view this post on Zulip Marten (Dec 11 2023 at 23:08):

Anyone got an idea why these two might not be equivalent?

indices
|> List.walk [] \state, index ->
    indices
    |> List.dropIf \a -> a == index
    |> List.walk state \otherState, otherIndex ->
            ...
indices
|> List.walk [] \state, index ->
    indices
    |> List.walk state \otherState, otherIndex ->
            if index == otherIndex then
                otherState
            else
                ...

https://github.com/WhileTruu/advent-of-code-2023/blob/main/day-11.roc

The examples and tests I could come up with were all succeeding with both versions, but replacing the dropIf with the if else in the nested walk got me the right answer ...after banging my head against the wall for several hours :D

view this post on Zulip Brendan Hansknecht (Dec 12 2023 at 05:41):

This is probably a compiler bug

view this post on Zulip Brendan Hansknecht (Dec 12 2023 at 05:53):

Though both seem to give the same answer for me...

view this post on Zulip Brendan Hansknecht (Dec 12 2023 at 05:54):

Though maybe that is due to the new isInState check

view this post on Zulip Brendan Hansknecht (Dec 12 2023 at 06:02):

Ah, results only break with --optimize 100% must be a compiler bug.

view this post on Zulip Marten (Dec 12 2023 at 19:21):

Brendan Hansknecht said:

Ah, results only break with --optimize 100% must be a compiler bug.

I added it as an issue https://github.com/roc-lang/roc/issues/6264, let me know if I should formulate it better or sth

view this post on Zulip Brendan Hansknecht (Dec 12 2023 at 19:37):

If you have any time and can make a smaller repro, that is always helpful, but otherwise, that's great.

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

Here's my day 11: https://github.com/ryanb/advent-2023-roc/blob/main/day11/main.roc

view this post on Zulip Johan Lindskogen (Dec 13 2023 at 20:32):

Finally back at it! Solved day 11: https://github.com/lindskogen/advent-of-code-2023/blob/main/day11/main.roc


Last updated: Jul 06 2025 at 12:14 UTC