"Guard Gallivant" - Day 6 - Advent of Code 2024 #AdventOfCode https://adventofcode.com/2024/day/6
in Zig and Haskell
My straightforward brute force solution to day 6 part 2 does quite a lot of work. The Haskell version takes 10 seconds on my laptop.
https://github.com/justinhj/advent-of-haskell/blob/cc53137bfc071d1d30bee2ce1e7e70d138bdf6ec/problems/DaySix/PartTwo.hs#L106
1/6
in Zig and Haskell
My straightforward brute force solution to day 6 part 2 does quite a lot of work. The Haskell version takes 10 seconds on my laptop.
https://github.com/justinhj/advent-of-haskell/blob/cc53137bfc071d1d30bee2ce1e7e70d138bdf6ec/problems/DaySix/PartTwo.hs#L106
1/6
Comments
Zig support is not great and I flitted between between Claude, Copilot, ChatGPT
2/6
Interestingly none of them could help me make a working simple build in the first instance and I had to resort to RTFM
3/6
https://github.com/justinhj/advent-of-haskell/blob/cc53137bfc071d1d30bee2ce1e7e70d138bdf6ec/ZigDaySix/src/main.zig#L255
4/6
There is no Set in the stdlib, but maybe it's easy to find a community implementation, this was day 1 of Zig for me so I don't know.
6/6