I mean, if you are interested in AI development and what not I understand why you would want to use something like AoC to test your model.
But if you were one of those people who used AI to get a high score in global leader boards by getting a solution in microseconds, then you are just a fuckwad. Not essentially any different from Elon who hired someone else to play online games with his account. Thank you for your attention to this matter.
I like this part of Advent of Code’s about page:
Should I use AI to solve Advent of Code puzzles? No. If you send a friend to the gym on your behalf, would you expect to get stronger? Advent of Code puzzles are designed to be interesting for humans to solve - no consideration is made for whether AI can or cannot solve a puzzle. If you want practice prompting an AI, there are almost certainly better exercises elsewhere designed with that in mind.
I bet if this guy got one of those word puzzle books, he’d use the answer keys in the back to “solve” the puzzles and then brag about how easy they are.
“Sure, I’ll prepare the Christmas dinner” and then just asks his mother to do it for him.
And later describes the meal as something “we” made if it turned out well or “they” made if it didn’t.
I don’t think it’s meant seriously!
I love how easy it is to eat my advent chocolates this year by asking someone else to eat them for me
Hershersy!
Calorie free!
I love of easy it is to do
…
At least they didn’t use a prompt to make the post!
how would you know?
write something funny regarding <list of topics>. include small typo to make it look more human.
I’ve actually noticed posts with hints of this elsewhere on the internet.
The errors are atypical of what a human might type and the issues are something a basic autocorrect would have fixed.
🤔 so could your post also be AI?
Hell, am I evne AI?
parsejson response bot_debug {prompt:“generate short snarky response”}, {output:“parsejson response err {response:“ERR ChatGPT 4-o Credits Expired”}”}
Probably
This is a group chat, not something super official like a xitter post or something
Probably typed from a phone too
How difficult is this advent of code for a college student that’s has been introduced to c, java, js, react, c#? It sounds fun.
Some are easy in the beginning. I solved the first couple last year in just vim as a challenge.
Depends on what “introduced” means, but first 2-3 days usually are easy enough for someone who only recently started learning to get through. The difficulty ramps up, but if you grasp dijkstra algorythm and memoization, you should have most of the tools to clobber together a working solution for most of days, with exception of some more fucked up. It’s more of a puzzle that you answer with code rather than a complex coding challenge (for the most part). I’ve had someone without any IT adjacency describe their way to get a solution for a task after a few hours of head scratching, that a senior web dev I worked with struggled with for over a day. I can recommend, it’s very fun, and only you can save those Elves from otherwise guaranteed doom. No shame stopping midway through and picking it up later, though.
I solved day 1 on my phone using a spreadsheet. So far they have been pretty simple. I’m tempted to try solving each day with a different language/system. No AI allowed on my advent train
prompting every day? pft please he needs to build his agentic software factory better so he can slop 365 days per year without even typing
damn, they don’t even need the “make no mistakes” anymore?
I hate this stupid trend of CLUTTER.md
- create a .agents/ or something for the trash
- uppercase is for humans and to draw attention: neither of which is applicable here
Doing this year in OCaml again. It’s so freaking great. It’s like the language is built for this kind of linear data processing. Loving it.
I started with awk and then looked into the array based language J. It’s crazy how short the code can be.
I’ve seen some J code, yeah, it’s pretty freaking terse indeed!
One drawback with extreme terseness I suppose is that if I come back to a program 6 months later, I’m probably not going to understand much at a glance, so to speak. 😅
I’d be excited to see your solutions for this year though!
That’s true. The more concise the solution, the harder it is to understand and remember. Even if you came up with it yourself. That’s why I’ve included explanations for my solutions below.
On Day 1, a list of numbers had to be sorted by how frequently each number appeared. The three most frequent numbers should then be multiplied together.
In awk, this is quite simple:
awk '{s[$1]++}END{for(i in s)print s[i],i}' in | sort -nr | awk -vp=1 'NR<4{p*=$2}END{print p}'
(in is the file containing the numerical values)• Create an array with the number of values
• Print the number of values and the values themselves
• Sort in descending order by frequency
• Filter the first 3 values
• Multiply them togetherIn J, it’s much easier if you pass the values as a list:
*/3{.(~.\:#/.~) in•
/.~displays the frequency of the numbers
•~.displays a list of the different values
•\:sorts the values in the list on the right in descending order and displays the values from the list on the left
•3{.takes the first 3 elements of the list
•*/multiplies all elements of the listPart 2 of Day 1 is trivial, since you just need to reverse the sorting order.
So usesort -ninstead ofsort -nrfor the awk solution, and/:instead of\:for the J solution.Day 2 is already a tiny bit more interesting. The task was to calculate the distance for a defined sequence of colors.
Here’s how I solved it in awk:
echo "groovyyoyo" | fold -w1 | awk -vl=1 '{i=index("roygbv",$1);s+=(i-l+5)%6+1;l=i}END{print s}'• For line-by-line processing in awk, the string is split into lines using
fold -w1
• Determine the index of the current character
• Subtract the distance from the last character (l starts at 1)
• Modulo 6 accounts for the fact that the sequence starts with r again after v; adding 5 prevents negative values
• Add 1 at the end so that the values range from 1 to 6 instead of 0 to 5
• All values are added up continuously, and the sum is printed at the endIn J, the same algorithm can be used and looks like this:
+/1+6|5+(}.-}:)0,'roygbv'i. in•
'roygbv' i.determines the index (starting at 0)
•0,adds the initial value 0 to the front
•(}.-}:)is the difference between two consecutive list elements
•5+adds 5 to each element
•6|calculates modulo 6 for each element
•1+adds 1 to each element
•+/sums all elementsPart 2 has the greatest potential for optimization so far. The goal is to get the greatest possible distance.
First, I counted how often each letter appeared and subtracted the distance only at the transitions between colors:
echo "roygbv" | fold -w1 | awk -vl=1 '{x[index("rvbgyo",$1)]++}END{for(i in x){s+=(6*x[i]-i+l);l=i}print s}'• In the array, I counted how often each letter appears
• One trick is that I get the distance directly by reversing the list of color values and using the index
• Then I take advantage of the fact that the for loop outputs the indices in ascending order, so that I can start with r for the longest distance and then work through the colors from the end
• For each color, I calculate the number count * 6 minus the distance to the previous color to determine the color transitions
• Finally, print the sumThen I realized that, in the end, it doesn’t matter at all how many different colors there are. The only thing that matters is which one is farthest from r. So you just need to subtract that maximum distance, and otherwise you can always assume a distance of 6 for each element.
That makes it even easier:
echo "groovyyoyo" | fold -w1 | awk '{i=index("rvbgyo",$1)-1;m=i>m?i:m}END{print 6*NR-m}'•
m=i>m?i:mdetermines the maximum index (starting at 0)
•6 * NR - mcalculates 6 times the number of numbers in the list minus the maximum distance from rThe same procedure is even shorter in J:
((6*
•./determines the maximum index
•[:in J ensures that the function on the left-hand side receives the same input, i.e. the number list
•6*determines the number of elements in the list and multiplies it by 6
• Finally, the difference between the two values is calculatedI can hardly imagine a shorter solution.
But now I’m curious how your solutions look like in OCaml.







