Stream: roctoberfest

Topic: 2023 day 6


view this post on Zulip Elias Mulhall (Oct 06 2023 at 16:16):

Day 6: https://github.com/mulias/roctoberfest/blob/main/advent_2022/day_06/main.roc

main =
    part1 = puzzleInput |> firstStartOfPacketMarker |> Num.toStr
    part2 = puzzleInput |> firstStartOfMessageMarker |> Num.toStr
    Stdout.line "Part 1: \(part1)\nPart 2: \(part2)"

If I change either part1 or part2 to "0" and only run one of the parts then it works fine. Running roc test successfully tests both values.

view this post on Zulip Anton (Oct 06 2023 at 16:30):

Thanks for reporting this @Elias Mulhall, can you share the input.txt and example.txt too so that we can try to reproduce the issue?

view this post on Zulip Elias Mulhall (Oct 06 2023 at 16:50):

Sure thing, here's a gist https://gist.github.com/mulias/f3efc91bf8787349bc1c5f26e88c898c

view this post on Zulip Elias Mulhall (Oct 06 2023 at 16:58):

I'm messing with it again and the behavior is a bit more complicated. If I delete the executable then neither roc test or roc run works. I just tried commenting out both part1 and part2 in main, creating an executable with roc run, adding back part1, roc run then adding back part2, then finally roc run. That worked. I wonder if it has something to do with the puzzle input being a single line 4095 character string.

view this post on Zulip Anton (Oct 07 2023 at 09:57):

I've created #5890 for this.


Last updated: Jul 06 2025 at 12:14 UTC