Trending
insolor's Avatar

insolor

@insolor

Python developer, learning ziglang https://github.com/insolor Founder of the Dwarf Fortress (fan) localization project https://github.com/dfint

42
Followers
24
Following
17
Posts
05.12.2024
Joined
Posts Following

Latest posts by insolor @insolor

#AdventOfCode 2024 in #ziglang
Day 12:
- part 1 done.
- part 2 - not sure how to solve it. Delayed for now.

12.12.2024 20:41 ๐Ÿ‘ 5 ๐Ÿ” 0 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 0

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 :)

12.12.2024 10:48 ๐Ÿ‘ 2 ๐Ÿ” 0 ๐Ÿ’ฌ 1 ๐Ÿ“Œ 0

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 :)

12.12.2024 10:46 ๐Ÿ‘ 0 ๐Ÿ” 0 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 0

The only thing I can say, part 2 can be solved fast and with minimal memory consumption.

11.12.2024 20:48 ๐Ÿ‘ 1 ๐Ÿ” 0 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 0
Day 11 - Advent of Code 2024

I just completed "Plutonian Pebbles" - Day 11 - Advent of Code 2024 #AdventOfCode adventofcode.com/2024/day/11

11.12.2024 20:45 ๐Ÿ‘ 1 ๐Ÿ” 0 ๐Ÿ’ฌ 1 ๐Ÿ“Œ 0

Thanks, I've got an idea

11.12.2024 20:24 ๐Ÿ‘ 0 ๐Ÿ” 0 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 0

I tried, and I failed :) I hope, free disk space won't end too soon

11.12.2024 20:12 ๐Ÿ‘ 0 ๐Ÿ” 0 ๐Ÿ’ฌ 1 ๐Ÿ“Œ 0

#AdventOfCode 2024 in #ziglang
Day 11:
- part 1 done
- part 2 is potentially solved, but the result is still in the process of calculation

11.12.2024 19:18 ๐Ÿ‘ 3 ๐Ÿ” 0 ๐Ÿ’ฌ 1 ๐Ÿ“Œ 0

#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.

11.12.2024 12:03 ๐Ÿ‘ 4 ๐Ÿ” 0 ๐Ÿ’ฌ 1 ๐Ÿ“Œ 0

#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.

11.12.2024 11:57 ๐Ÿ‘ 1 ๐Ÿ” 0 ๐Ÿ’ฌ 1 ๐Ÿ“Œ 0

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

11.12.2024 11:57 ๐Ÿ‘ 1 ๐Ÿ” 0 ๐Ÿ’ฌ 1 ๐Ÿ“Œ 0

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.

07.12.2024 12:22 ๐Ÿ‘ 0 ๐Ÿ” 0 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 0

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.

07.12.2024 12:22 ๐Ÿ‘ 0 ๐Ÿ” 0 ๐Ÿ’ฌ 1 ๐Ÿ“Œ 0

Thanks for the review!
Yes, you are right, this is reasonable to return ?Position instead of panic, if there's no `^` character.

07.12.2024 12:22 ๐Ÿ‘ 0 ๐Ÿ” 0 ๐Ÿ’ฌ 1 ๐Ÿ“Œ 0
Preview
aoc2024.zig/src/day06.zig at main ยท insolor/aoc2024.zig Advent of Code 2024 in zig. Contribute to insolor/aoc2024.zig development by creating an account on GitHub.

#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...

06.12.2024 19:41 ๐Ÿ‘ 0 ๐Ÿ” 0 ๐Ÿ’ฌ 1 ๐Ÿ“Œ 0
Day 6 - Advent of Code 2024

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.

06.12.2024 19:41 ๐Ÿ‘ 1 ๐Ÿ” 0 ๐Ÿ’ฌ 1 ๐Ÿ“Œ 0
Day 5 - Advent of Code 2024

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...

05.12.2024 17:15 ๐Ÿ‘ 2 ๐Ÿ” 1 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 0