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.
https://github.com/timotree3/aoc2023/blob/main/roc/day11.roc
Difficulty
https://github.com/ostcar/aoc2023/blob/main/days/day11.roc
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
This is probably a compiler bug
Though both seem to give the same answer for me...
Though maybe that is due to the new isInState
check
Ah, results only break with --optimize
100% must be a compiler bug.
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
If you have any time and can make a smaller repro, that is always helpful, but otherwise, that's great.
Here's my day 11: https://github.com/ryanb/advent-2023-roc/blob/main/day11/main.roc
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