End of an era for sure. Bitter sweet....
End of an era for sure. Bitter sweet....
I made an "nm_pairs" view during #AdventOfCode, largely as a tool to better understand what it takes to make a custom view in #C++.
github.com/int2str/nm_p...
I made an "nm_pairs" view during #AdventOfCode, largely as a tool to better understand what it takes to make a custom view in #C++.
github.com/int2str/nm_p...
I was absolutely sure the compiler (clang-18) would do this for me, but alas, it didn't.... Went from ~40ms to ~20ms.
Hat tip to @49pctber.bsky.social
I peeked at their code and was like "nah, THAT can't be it..."
I was absolutely sure the compiler (clang-18) would do this for me, but alas, it didn't.... Went from ~40ms to ~20ms.
Hat tip to @49pctber.bsky.social
I peeked at their code and was like "nah, THAT can't be it..."
This makes the final #AdventOfCode problem super nice in C++!
I need to do a proper write-up on both the AoC problem, as well as the difficulties of making a C++23 custom view....
This makes the final #AdventOfCode problem super nice in C++!
I need to do a proper write-up on both the AoC problem, as well as the difficulties of making a C++23 custom view....
Man, if I could just turn my mn_const_view() into an actual view, this would actually have been a "one liner" in C++ :)
Thank you, AoC team and participants!
Merry x-mas and happy holidays!!!!!!
Man, if I could just turn my mn_const_view() into an actual view, this would actually have been a "one liner" in C++ :)
Thank you, AoC team and participants!
Merry x-mas and happy holidays!!!!!!
Using a flat array and a bitset, Day 22 went from my slowest to be super fast!
#AdventOfCode
Using a flat array and a bitset, Day 22 went from my slowest to be super fast!
#AdventOfCode
#AdventOfCode
#AdventOfCode
#AdventOfCode
#AdventOfCode
Maybe it's the embedded programmer in me, but I always gravitate towards bit-masks for problems like these. No recursion, no graph theory etc., just a bunch of bits...
Maybe it's the embedded programmer in me, but I always gravitate towards bit-masks for problems like these. No recursion, no graph theory etc., just a bunch of bits...
Day 22 was an absolute breeze and a blast, after 21 was a thorough kick in the pants for me... Both done now and officially caught up!
Always fun to use fold_left() weirdly :)
Hopefully, no more hard ones 'til x-mas :D
Day 22 was an absolute breeze and a blast, after 21 was a thorough kick in the pants for me... Both done now and officially caught up!
Always fun to use fold_left() weirdly :)
Hopefully, no more hard ones 'til x-mas :D
#AdventOfCode
After finishing Day 17 four days ago, I went back and actually implemented a JIT compiler that reads the program from file and emits x86_64 assembly :D
Works for the quine, sample and my input and is blazingly fast!
TOTAL overkill but fun learning!!
#AdventOfCode
After finishing Day 17 four days ago, I went back and actually implemented a JIT compiler that reads the program from file and emits x86_64 assembly :D
Works for the quine, sample and my input and is blazingly fast!
TOTAL overkill but fun learning!!
Turns out the algorithm was fine, but the C++ std::unordered_map<> (specifically the hashing) is slow... Switched to a plain array to store distances and voila...
#AdventOfCode
Turns out the algorithm was fine, but the C++ std::unordered_map<> (specifically the hashing) is slow... Switched to a plain array to store distances and voila...
#AdventOfCode
Hmmmm, this is now by far my longest running algorithm for AoC. N*M is never pretty, I guess. I am probably missing an obvious shortcut somewhere (pun intended ;) ) ...
Hmmmm, this is now by far my longest running algorithm for AoC. N*M is never pretty, I guess. I am probably missing an obvious shortcut somewhere (pun intended ;) ) ...
Inspired by @swcreeperking.bsky.social , I added the ability to print timing info to my little unit test framework.
Inspired by @swcreeperking.bsky.social , I added the ability to print timing info to my little unit test framework.
Mega fun today writing a cute little "virtual machine" :)
Thought about implementing a JIT :D
And a fun little "Quine detector" for part 2.
Great puzzle today! I needed that after 16..
github.com/int2str/adve...
Mega fun today writing a cute little "virtual machine" :)
Thought about implementing a JIT :D
And a fun little "Quine detector" for part 2.
Great puzzle today! I needed that after 16..
github.com/int2str/adve...
This one kicked my butt a bit, not gonna lie. Spent some quality time on Wikipedia... But hey, at least I have a generic implementation of Dijkstra's algorithm in C++ now :)
github.com/int2str/adve...
This one kicked my butt a bit, not gonna lie. Spent some quality time on Wikipedia... But hey, at least I have a generic implementation of Dijkstra's algorithm in C++ now :)
github.com/int2str/adve...
#AdventOfCode - Day 15
#AdventOfCode - Day 15
Two more gold stars and one more chance to practice SFML :)
github.com/int2str/adve...
Two more gold stars and one more chance to practice SFML :)
github.com/int2str/adve...
#AdventOfCode
#AdventOfCode
Well, that was fun! Thanks to @mei-eisenbach.bsky.social , we found no less than two algorithms to hone in on the "Anomaly".
Really curious what others have done for this!
github.com/int2str/adve...
Well, that was fun! Thanks to @mei-eisenbach.bsky.social , we found no less than two algorithms to hone in on the "Anomaly".
Really curious what others have done for this!
github.com/int2str/adve...
All 13 days so far now execute in ~200ms, running sample AND final input calculations.
#AdventOfCode
All 13 days so far now execute in ~200ms, running sample AND final input calculations.
#AdventOfCode
(No math spoilers)
How dare they make me do math during the holidays - my brain hurts :p
With my ever growing "Coordinate" class and more std::ranges, the code is nice and compact though.
github.com/int2str/adve...
(No math spoilers)
How dare they make me do math during the holidays - my brain hurts :p
With my ever growing "Coordinate" class and more std::ranges, the code is nice and compact though.
github.com/int2str/adve...
Day 12 in the bag finally.... A bit late, but did a bunch of infrastructure work to make this less of a pain.
github.com/int2str/adve...
I heard #13 is math problem, so I might be screwed ...
Day 12 in the bag finally.... A bit late, but did a bunch of infrastructure work to make this less of a pain.
github.com/int2str/adve...
I heard #13 is math problem, so I might be screwed ...