Last year, I tried to go hard on modern C++ and ranges/views.
This year, Rust! This is a learning exercise for me, so I'm guessing my code is far from idiomatic....
!!! Spoilers !!!
github.com/int2str/adve...
Last year, I tried to go hard on modern C++ and ranges/views.
This year, Rust! This is a learning exercise for me, so I'm guessing my code is far from idiomatic....
!!! Spoilers !!!
github.com/int2str/adve...
End of an era for sure. Bitter sweet....
End of an era for sure. Bitter sweet....
How to make custom C++ views:
whtwnd.com/int2str.net/...
How to make custom C++ views:
whtwnd.com/int2str.net/...
- @forrestvalkai.bsky.social , 2025
lol :)
- @forrestvalkai.bsky.social , 2025
lol :)
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....
wc -l -> Get number of lines in a file (you did that)
wc -L -> Gets longest line in the file ;)
So, grid size for day 16 -> wc -lL
#AdventOfCode
wc -l -> Get number of lines in a file (you did that)
wc -L -> Gets longest line in the file ;)
So, grid size for day 16 -> wc -lL
#AdventOfCode
Here's my write up of my #AdventOfCode "solution" for Day 17.
Here's my write up of my #AdventOfCode "solution" for Day 17.
9598 lines of C++
64 unit tests
3 SFML animations
1 x86_64 JIT compiler
25 awesome puzzles (well except you, day 21...)
50 stars :)
Thank you, #AdventOfCode!
I tried a whole bunch of new/different things and had a blast learning all December!
Public repo:
github.com/int2str/adve...
9598 lines of C++
64 unit tests
3 SFML animations
1 x86_64 JIT compiler
25 awesome puzzles (well except you, day 21...)
50 stars :)
Thank you, #AdventOfCode!
I tried a whole bunch of new/different things and had a blast learning all December!
Public repo:
github.com/int2str/adve...
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!!!!!!
Ohhhhh nooooo AoC - I'm almost done writing a completely unnecessary, overkill JIT compiler for Day 17.... Don't make me write another one!!! :p
Ohhhhh nooooo AoC - I'm almost done writing a completely unnecessary, overkill JIT compiler for Day 17.... Don't make me write another one!!! :p
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!!
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.
18 days completed and all 37 test cases (full input data + samples) still run in a total of less than 300ms on my machine - nice!
github.com/int2str/adve...
18 days completed and all 37 test cases (full input data + samples) still run in a total of less than 300ms on my machine - nice!
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...
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...
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...
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...