Awesome
I just finished Day 19, definitely the hardest for me so far since I suck at regex. Would be interesting to know if anyone else here actively solves these every day?
I haven't missed anything so far but yeah, you can just skip whatever you want this year. It was different in 2019 when half of the problems depended on eachother (you had to write a VM).
I solved day 18 1st half in some complex way (I thought about writing a reverse polish calculator but considered it would take me too much time so basically TDD'ed a 3-way decision table with switches). For the second half at first I tried to make that table configurable but decided to write a new "AdvancedLong" type that would act as a Long type but overrode the * operator so that it acted as +, and the + so that it acted as *, then
rewrote the puzzle input to work in terms of this new type, and it worked. I thought that was brilliant (if I can say it myself
).
Later that day I wrote the solution using RPN, just need to refactor it to make it work with both puzzles. Truth be told it had been like 20 years since I last wrote one in C so there were parts I couldn't remember. I checked at Computerphile and tried to implement it as a stack but didn't work
In the end I implemented it with a list for the final equation and one stack per parenthesis set.
Today's was hard too. I'm a fan of formal grammars, automatas and the like (used to write compilers for my scripting engines with
bison and
yacc) so I immediately understood what I had to do. I also found it odd that there were no loops and guessed they were going to appear in the second half, so decided not to build a full automata and instead build a decision table with the rules. For the second half I decided to follow their suggestion and instead of using backtracking and having to decide which route to go with the recursive rules I would just expand them all until one branch is able to parse the whole message or all of them fail. It took me quite a while to implement the idea, at all times I was with like 18 failed unit tests, and suddenly I return the list with consumed items and suddenly everything turned green.
Kind of surprised that so few have passed today, it's at about 10k only, that's like half of the ones that solved yesterday successfully which makes me believe there are a lot of people who are solving the latest puzzles
By the way, have you ever scored a point there?
What's everyone's favorite project they have worked on? I'll go first.
Hey, I want to learn ps, especially now that it's available on Linux. The fact that you can load assemblies is awesome. Still got some books in my queue but whenever I finish enough I was considering buying
Learn Windows PowerShell in a Month of Lunches.
As for projects I got several work-related ones but the one I use the most is actually a set of command-line utilities I wrote in Python 2.7 (which is not my main language btw) to interact with the broadcasts at
Showroom, a Japanese streaming service. It runs 24/7 keeping track of broadcasts, automatically collecting items from rooms to throw them in my favorite streamers when they go online, log the chat, automatically collect new avatars from any room, throw massive amounts of paid gifts in a short period of time, etc. At work we are migrating 1.2m of VB6 code into C# using an automatic translator and adding modifications to Roslyn, the C# compiler. If it works it'll be something we'll be proud of. The document importer feature of our product came from an idea I had back in 2003 when I noticed they were doing it manually and I guessed we could write our own optimized regex parser. It worked so well that it's still in use, it's fast and can be configured without touching a single line of code.