#AdventOfCode 2024 in #ziglang
Day 12:
- part 1 done.
- part 2 - not sure how to solve it. Delayed for now.
#AdventOfCode 2024 in #ziglang
Day 12:
- part 1 done.
- part 2 - not sure how to solve it. Delayed for now.
I've looked up the code (I wanted to know how the graphics is done), and surprisingly it is done in terminal, just with emojis :)
Yes, this is another way to do it. I'm moving to zig from python, and I think in sets and dicts. Using of a 2d bool array is an interesting approach, I'll remember it :)
The only thing I can say, part 2 can be solved fast and with minimal memory consumption.
I just completed "Plutonian Pebbles" - Day 11 - Advent of Code 2024 #AdventOfCode adventofcode.com/2024/day/11
Thanks, I've got an idea
I tried, and I failed :) I hope, free disk space won't end too soon
#AdventOfCode 2024 in #ziglang
Day 11:
- part 1 done
- part 2 is potentially solved, but the result is still in the process of calculation
#AdventOfCode 2024 in #ziglang
- Day 10: part 1 was simple, part 2 was even simpler (just counting instead of using of a hash set). ~1h 20min for the first part, 8 min for the second part.
#AdventOfCode 2024 in #ziglang
- Day 9: done first part 1, second part works on the test sample, but fails on the full data. Reimplemented in python with slightly different approach. Gives the same result on full data. Skipped for now.
My progress in #AdventOfCode 2024 in #ziglang:
- Day 7: first part was simple, got the task for the second part wrong, fixed, didn't work, reimplemented in python, found the bug, fixed zig implementation
- Day 8: both parts were simple
About snake case, I'm still getting used to the naming conventions of zig. I used to write code in Java, and it seems that my brain just automatically applied their naming convention to the code in zig.
As for ArenaAllocator, it is useful for such short tasks in general, but I'm still learning zig, and I'm trying to discipline myself to not forget to add necessary defers.
Thanks for the review!
Yes, you are right, this is reasonable to return ?Position instead of panic, if there's no `^` character.
#ziglang #AdventOfCode 2024 day 6
The second part works a bit slowly on the full data (about a minute), but it's good enough. And I compiled it in the debug mode, compilation in the release mode could make it faster, I think.
github.com/insolor/aoc2...
I've completed "Guard Gallivant" - Day 6 - Advent of Code 2024 #AdventOfCode adventofcode.com/2024/day/6
#ziglang
It completely drained my brain power, but I've managed to solve it.
I just completed "Print Queue" - Day 5 - Advent of Code 2024 #AdventOfCode adventofcode.com/2024/day/5
#ziglang
Today, I've learnt how to use a custom comparator for sorting in zig language. Today's code: github.com/insolor/aoc2...