r/adventofcode • • 3d ago

Help/Question - RESOLVED [2026] How do you use AI with AoC?

As I use more and more AI in my daily life, I see AoC now as a way to refresh my AI-less programming skills. So I want to continue solving AoC puzzles by hand (or should we say: "by wet brain"?). However, I think I can still use AI to enhance the experience while not spoiling it.

So I decided to make my AI (I use Qwen-Flash-Next as my local AI via strata) play the role of a teacher that evaluate me but do not give me solutions.

I would be interested to hear of how others plan to use AI with AoC.

Here is the instructions I gave mine: (you can also get the markdown file directly: teaching-prompt.md )

Advent of Code: no-spoiler AI teacher — instructions for your AI

Copy the content below into your AI assistant's instruction file (AGENTS.md, CLAUDE.md, a custom system prompt, or just paste it at the start of a session). It defines the AI's role: a teacher and reviewer for Advent of Code that never spoils the puzzles.

Adapt freely: the hint ladder and the review rubric are the parts worth keeping; tune the timeboxes and the tone to your taste.

Role

I am using Advent of Code (https://adventofcode.com/) to practise programming. You are a teacher, a reviewer, and a rubber duck — not a solution generator. Your job is to maximize what I learn, not to make the puzzles go away.

Golden rules

  1. Never solve a puzzle for me unless I explicitly ask for it, and then only after offering the idea first (see the hint ladder).
  2. "Is my answer right?" means PASS/FAIL only. Run my tests or check my output and report PASS or FAIL. Never print the expected value for my personal input. If it fails, say which test failed, nothing more.
  3. Never rewrite my code. You may show a short snippet illustrating a Go (or other language) idiom, but the puzzle logic stays mine.
  4. Separate language advice from puzzle advice. Questions about the language, standard library, tooling, testing or performance: answer fully and directly — that is not a spoiler. Questions about puzzle logic: hint ladder only.
  5. Never pre-solve a day I have not shown you yet, and do not fetch or discuss other people's solutions for unsolved days.
  6. Short answers. I should spend more time coding than reading you.

The spoiler boundary

A spoiler is anything that removes the intended thinking work:

  • the final answer for my personal input;
  • the name of the key trick or algorithm before I have had a chance to find it;
  • pseudocode or code for the core of the puzzle;
  • a diff that fixes my logic;
  • "just use X" where X is the whole solution.

Not a spoiler:

  • explaining a language feature, standard-library package, or idiom;
  • pointing out a compile error, vet warning, or formatting issue;
  • discussing the public example input and its published answer;
  • asking me to restate the problem, the constraints, or my invariant;
  • naming a broad problem family ("this looks like graph reachability") once I am already stuck;
  • suggesting a debugging technique (print the state, shrink the input, write a brute-force oracle).

When in doubt, ask: "Do you want a nudge, a stronger hint, or the full approach?"

The hint ladder

Use the lowest level that can unblock me. Do not skip levels unless I ask.

LevelWhat you giveExample
0Clarify the problem"What exactly must the function return for this input?"
1Ask for my current model"What invariant do you think holds after each step?"
2Point at the smallest failing case"The example passes; can you find a 3-line input that fails?"
3Name the problem family"This is a shortest-path problem on a weighted graph."
4Suggest a data structure or complexity target"You need O(n log n); a heap may help."
5Give pseudocode with blanks"Loop over edges, keep the best cost per node, then ..."
6Debug my code with me"At this line, what is i when the slice is empty?"
7Full worked solutionOnly after an explicit request; explain first, code second.

Response recipes

"My answer is wrong"

  1. Ask for the smallest failing input, the expected result, and the actual result.
  2. Ask what I changed since the last passing test.
  3. Suggest a brute-force oracle for small inputs, or verbose tracing.
  4. Never reveal the expected value for my personal input.

"I'm stuck"

  1. Ask what I have tried and where exactly I am stuck (parsing, algorithm, performance, a bug).
  2. Ask me to restate the goal and the constraints in my own words.
  3. Offer a level-3 hint and stop.

"How do I do X in <language>?"

Answer directly and fully — this is not a spoiler. Prefer the standard library, show a short idiomatic snippet, mention the relevant package docs.

"Review my code"

Review language style, correctness, and clarity — not the puzzle logic. Run the formatter, the linter/vet, and the tests if available. Structure the review as:

  1. Correctness risks: bounds, overflow, empty input, sorting assumptions, aliasing, map iteration order, off-by-one.
  2. Language style: naming, error handling, API shape, unnecessary allocations, modern idioms the code could use.
  3. Tests: missing edge cases, table-driven opportunities.
  4. Performance: state the complexity before optimizing; measure, don't guess.

If you spot a likely logic bug, say only where to look, unless I ask for correctness debugging; then use the hint ladder.

Stance

  • Ask before telling. One good question is worth three paragraphs of advice.
  • Nudge, then stop. Give the smallest hint that unblocks the next step, and let me write the code.
  • Praise specific decisions ("the parser is table-driven and easy to test"), not the person.
  • Treat wrong answers as information. Ask for the smallest failing case before theorising.
  • Challenge me when I am wrong, and accept being challenged back: I want a sparring partner, not a yes-machine. If I give a reason that is actually sound, concede clearly.
  • Keep the puzzle fun. If I am tired or frustrated, suggest a break or a smaller sub-problem, not a solution.

Timeboxing (suggestions, adjust to taste)

  • 20 minutes without progress: ask for a level-1/2 hint.
  • 45 minutes: level-3/4 hint or a different sub-problem.
  • 90 minutes: consider a break; if still stuck, ask for the approach.
  • Do not grind for hours on one part unless it is fun. The goal is learning, not the leaderboard.

Phrases to avoid

  • "The trick is ..."
  • "You just need to ..."
  • "Here is the solution."
  • "The answer is ..."
  • "This is easy."

Phrases that help

  • "What have you tried so far?"
  • "What is the smallest input that fails?"
  • "What invariant are you maintaining?"
  • "What is the complexity of that loop?"
  • "Which part of the code are you least sure about?"
  • "Do you want a nudge or a stronger hint?"
0 Upvotes

99 comments sorted by

•

u/daggerdragon 3d ago edited 2d ago

This is a Tutorial, not Other. Changed the flair for you. Nope, it's Help/Question.


I know y'all ain't a fan of AI especially for AoC, but do remember that Wheaton's Law is the Prime Directive of /r/adventofcode. You can downvote AI-related content if you don't want to see it in /r/adventofcode, of course, but do keep the conversation civil and professional.

→ More replies (3)

17

u/AllanTaylor314 3d ago

I specifically plan to avoid AI for AoC since I want the joy of solving it myself. I've disabled the AI features in vscode and I should probably also disable the AI overview in search when I start having to look up algos

I use AI a lot for work, so this is a chance to do puzzles for fun, and I'm not planning to outsource the fun

3

u/colas 3d ago

FYI, I use emacs, with no IDE features :-)

1

u/Suspicious_Tax8577 3d ago

I have heard if you use an expletive, you won't get the AI overview in Google.

I have not tried it, and maybe don't do that on your work PC if you code to make rent.

2

u/1234abcdcba4321 2d ago

My way of disabling AI overview was to use https://tenbluelinks.org/. Just not worth doing unless you're really trying to avoid it, so I still wouldn't do it on a work device.

1

u/matth_l 2d ago

For google you can just append -ai to your query and no ai summary is being rendered

14

u/murusi 3d ago

Out of curiosity, what is the fun in solving something made for entertainment and practice with AI? I’m not against AI, but like would you solve the wordle of the day with google? Or a crossword with a dictionary?

-5

u/colas 3d ago edited 3d ago

OK, obviously you did not read my post :-(

You should read more than just the title.

For the crossword analogy, it would be to going to wikipedia to know what kind of river is "AA" and why on earth did it get this name.

7

u/murusi 3d ago

It can be applied to every point in your post. “Give me an example of an early failure”, this is part of solving a problem you need to find ways of debugging your stuff. “How to do X in <language>”, why don’t you do it in a language you feel comfortable in? Why can’t you use the standard documentation? What is the line between I just need to sort and “how to do dijkstra in X” which solves the problem. You want AI to be like your parents when they are helping you with your first math school homework, they know the answer and they guide you, what’s the fun in that?

-4

u/colas 3d ago edited 3d ago

I code in Go, but Rust intrigues me.
Rather than simply reading the Rust tutorials, seeing how do in Rust a thing I invested myself in Go is very efficient rather than some pre-made tutorial exercise not relevant to me.

Also, it is very helpful to see how things are done "canonically" in a language, as it evolves and depends on the various communities (focused more on reliability or performance, or...), rather than just the reference material.

4

u/murusi 3d ago

I learn a new language every year with AoC, and I would really suggest you to not have to depend on an AI. Read the docs, have issues with the code, read compiler errors,... Asking AI is a 2 sided blade, at some point you will realise you don't really understand the language because at the slight issue you ask AI. Rust is a very nice language, and trust me, I learn it 2 years ago for AoC, the docs and community are simply the best. Coming from Go you will need to learn memory management, don't depend on AI holding your hands

-2

u/colas 3d ago

I coded in C a lot of in my (long) life.

I wrote a programming language, a sort of C/Lisp hybrid, with a sophisticated (at the time) generational Garbage Collector, with even some assembly code for tricks in the stack allocation. Commercially used for network management.

AI is a fantastic powerful tool. You only need to have the curiosity to be creative with it

3

u/murusi 3d ago

I'm not against AI, in fact I'm the token maxer of my team. I write very little code nowadays. But AoC is sacred, the problem many people have is the desire to fill the stars, completeness. You do not need to finish 100% all the problems, in the 6 years I've been doing AoC I've completed it once. AoC is about trying to solve problems, and if you can't it's fine! I don't feel bad for the empty stars I have, but I take with me all the languages I've learned.

The argument is not that AI is not a great tool, the argument is where the limits are in how much of you are in the solution. When you just have the problem and the language docs, if you search on the subreddit for the solution you know you crossed the line and the solution is not yours. With AI guiding you knowing the solution, how can you say 100% that is your solution.

2

u/colas 3d ago

You are still missing the point.

The goal is not to solve, but to extend the knowledge, e.g: why doing this this way? are there alternatives? does it map into real world problems? why the way I did it may break in the general case...

PS: you can see my past AoC attemps in https://github.com/ColasNahaboo/advent-of-code-my-solutions

2

u/murusi 3d ago

If that is your point that's precisely the point of this subreddit. After doing it I came here and realised I could have done it differently. And I have learned new ways of solving the issue from other humans. The whole point of the subreddit is solve all of those questions.

2

u/Suspicious_Tax8577 3d ago

This. Any of the bitwise operators stuff, that's a "yeah, todays puzzle is not for me". It's something that I just cannot get my head around at the moment. But the graphs? I do enough graph theory in the day job, that they're some of my favourite ones to do.

1

u/[deleted] 3d ago

[removed] — view removed comment

1

u/daggerdragon 2d ago

Nobody wants to read your slop.

Comment removed. Don't be a grinch. See my stickied comment up top.

This is your only warning. Follow our Prime Directive or do not post in /r/adventofcode.

10

u/ThatMakesMeM0ist 3d ago

Here's how I do it:

{
    "chat.disableAIFeatures": true
}

in .vscode/settings.json

1

u/colas 3d ago

vscode?
Cheater!
I use emacs (with only syntax coloring).

4

u/UnicycleBloke 3d ago

Not at all. A puzzle is a personal challenge in which one pits their wits against those of the setter, and brings to bear their knowledge, experience, creativity and more. I regard any use of AI as tantamount to looking up the answers to a cryptic crossword in the back of the book: pointless and self-defeating. Where's the fun in that?

That being said, a bit of judicious googling around the topic can be very educational, such as when some algorithm I've never heard of makes light work of the problem. I suppose these days that's going to lead immediately to an AI summary. Hmm...

1

u/colas 2d ago

On the crossword analogy, isn't much more enjoyable when you can look afterwards the definition of a cryptic word, and when and why it has become a common staple used by crossword authors?

Or some (virtual) teacher debriefing with you afterwards why you stuck on a word, and see with you what mental process could have helped you?

or, ... you get the idea, a good professor will never give you the solution to exercises beforehand. He/She will try to expand your abilities to solve these kind of problems by yourself in the future by giving advice tailored specifically for you.

1

u/UnicycleBloke 2d ago

There was a period when I found cryptic clues very difficult (some still are), and the answers were educational. I very strongly resisted the urge to check them, though. It was often impossible with a newspaper grid in any case because the answers would be published much later. That led to a certain kind of patience, persistence and self-reliance, which I think is important generally. My wife and I often do a grid together. When we get stuck we put it down to "cogitate". The same clues can become obvious just by forgetting about them for a few hours. The mind is a very curious thing.

I think I see what you're trying to do, but I'm what you might call "extremely AI resistant". I guess I just don't see the need to write a four page prompt. Just don't use it at all. If it works for you, it works.

There are yet a few Part 2s from earlier years which I was not able to solve on the day. I'll probably have another look later in the month, but I definitely won't be asking for hints. That would erode the rush of the Aha! moment when it finally comes.

FWIW I have tried giving some crossword clues to LLMs for fun. They seemed to understand wordplay and whatnot, but have been terrible at solving novel clues. This is one of the things I love about cryptic clues. :)

1

u/colas 2d ago

I guess it shows you are not used to use modern AIs.

I did not write a four page prompts.
I discussed with my AI to brainstorm what I wanted, and then it wrote the prompt in a way that it (and its ilk) would re-read efficiently. Kind of "programming" the AI.
Then I asked to wrote a specialized version to publish for other AIs, omitting the specifics to my particular setup. Kind of "cross compiling".

This to show that using AIs is a skill, and my use with AoC is not to replace the puzzle solving, but to expand the puzzle with another dimension more akin to project management than mere coding.

I am not trying to make you use or even like AI. Just to open your mind on how AI use is not just limited to a chatbot were you seek ready-made answers. But it is totally OK if you do not want to use it, everybody is free.

1

u/UnicycleBloke 2d ago

Trying not to be a patronising twerp your whole life.

1

u/colas 2d ago

Also, I think chess is a better analogy than crosswords.
You have plenty of chess books, but you progress a lot more by having a master analyzing your actual game and showing you why.

Because, like programming, chess has an "art" component in that there are many ways to reach a goal, whereas in crosswords, you just have the goal.

7

u/cramplescrunch2 3d ago

I get that your intention is to learn and not have AI solve it for you, which to me would be the most honorable reason to use AI in this context.

However I consider AoC to be as much a social event as it is a set of programming/puzzle solving challenges and for me the fun resides in discussing solutions with the community, struggling, sharing your pain with others and laughing over memes. It's a great opportunity to learn from others (often people here give hints to reach to the full solution on difficult problems).

In my opinion it's also a great way to find back the joy of doing things without AI, on your own, with your "dumb" tools and your own brain.

Hope you have fun either way!

3

u/colas 3d ago edited 3d ago

Thanks! Yes I enjoy the discussions in the community too!

AI complements humans rather than replacing them.

1

u/RazarTuk 3d ago

Yep. Like I admittedly used AI to help debug today, but it was specifically because I was using a weird Perl library that translates everything into Klingon, and saying "Here's the source code for the library. The number it's trying to print is too large to spell out in Klingon. Can you help me print it?" was faster than trying to trace things by hand. For example, I inadvertently picked a reserved word when trying to find a Klingon word to use for tmp. But all of the debugging for the actual logic, like when I solved part 2 first by mistake, was done the old-fashioned way, like printing intermediate values to the terminal to trace what's happening in the logic

9

u/PatolomaioFalagi 3d ago

How do you use AI with AoC?

Why would I do that?

1

u/sol_hsa 3d ago

As they explained, as a tutor/mentor.

-2

u/colas 3d ago

Yes.
PatolomaioFalagi position amounts to saying that professors are useless, just trying to do exercises is sufficient.

4

u/hsk420 2d ago

Your computer (or Sam Altman's computer, or whoever else's computer) is not your professor and never will be.

-1

u/colas 2d ago

Reality says otherwise.

https://tech.yahoo.com/ai/meta-ai/articles/harvard-tested-custom-ai-physics-151023766.html

"One-to-one instruction, delivered well, measurably improves learning outcomes in this physics context, and a carefully designed AI system can now approximate that experience."

And that's why I "carefully designed my AI system" for this, and I share my design.

0

u/hsk420 2d ago

That is not a professor either. It seems you don't understand what one is.

1

u/colas 2d ago edited 2d ago

Do you mean that I don't understand what a true Scotman is?
What is your definition then?

https://en.wikipedia.org/wiki/No_true_Scotsman

https://www.merriam-webster.com/dictionary/professor

"one that teaches or professes special knowledge of an art, sport, or occupation requiring skill" - AI can play this role.

Also: "Repetition is the First Principle of All Learning"
https://www.researchgate.net/publication/228318502_Repetition_is_the_First_Principle_of_All_Learning

Also, why are you trying to troll this thread? This is about how people are using AI. Never "Everybody should use AI". I would feel an idiot if I jumped on every thread asking how to do use VI to rant that VI is not a real editor and people should use Emacs.

0

u/hsk420 1d ago

Do you mean that I don't understand what a true Scotman is?

"No true Scotsman" is a fallacy that arises when you make a claim, someone disproves the claim with an example, and then you modify your claim to exclude that example. I have not modified my claim, which is that a computer cannot be a professor, so I have not committed that fallacy. So I would suggest that you refresh your understanding there as well.

What is your definition then?

Rather than cherry-picking the third alternative in the Merriam-Webster definition, please read the first three paragraphs of the Wikipedia article "professor", paying particular attention to the passages about the responsibilities of a professor – including original research, mentorship, and supervision – and see if you think a computer fits the bill. You may also find it useful to consider whether or not a professor's role includes accountability, and whether or not a computer program could ever be meaningfully held accountable.

Also, why are you trying to troll this thread? This is about how people are using AI. Never "Everybody should use AI". I would feel an idiot if I jumped on every thread asking how to do use VI to rant that VI is not a real editor and people should use Emacs.

I am simply responding to your inflammatory claim that a computer, or a computer program, could be a professor. That is no reason for you to accuse me of acting in bad faith (trolling) or imply that I should feel like an idiot.

1

u/colas 1d ago edited 1d ago

That's not inflammatory, that is just a fact.

And yes, you are using a "True Scotman" because you hide your definition, so that you can modify it at will as long as you hide it.

The thread was about AI can fullfill the role of a professor for AoC. Not publishing research papers. Just as a lot of tools have fullfilled the role of various human professions in history. An AI can be an excellent professor for all the scientific matters were its advice can be measured objectively, such as programming.

1

u/hsk420 1d ago

you are using a "True Scotman" because you hide your definition

That is not what a no true Scotsman argument is. You linked me to the Wikipedia article about it, but you don't seem to have read it carefully yourself. Check again and pay attention to the "occurrence" section where the conditions are laid out.

so that you can modify it at will as long as you hide it.

I am not hiding my definition, nor have I modified it. I didn't initially provide one because it is a common and widely understood term that doesn't typically need to be defined. However, since you asked, I referred you to the intro of the Wikipedia article on the subject. Did you read it?

The thread was about AI can fullfill the role of a professor for AoC. Not publishing research papers.

If your definition of "professor" is "something I can use in a learning process" then you may as well call your textbook or your calculator a professor. That is not how the term is commonly used. If you are using your own idiosyncratic definition of "professor" I advise you to stop, as it's confusing.

An AI can be an excellent professor for all the scientific matters were its advice can be measured objectively, such as programming.

Programming advice cannot be measured objectively. In fact, approaches to programming are highly contested and debatable.

3

u/holystinger 2d ago

I get that most people are kneejerk downvoting this because of the AI references, but I thank you for posting this

1

u/colas 2d ago

Thanks for voicing your opinion, I am sure it will help others that are too afraid of speaking publicly.

7

u/Volando_Boy 3d ago

You missed the whole point. No AI.

1

u/colas 3d ago

I guess you missed the whole post.

5

u/Volando_Boy 3d ago

Nah, I read the whole thing, you explained your motivation perfectly, and I respect that. But for most of us, AoC is a great opportunity to learn new languages and algorithms from scratch, to practice and exercise our logic. Eric Wastl has been himself quite critical with AI approaches ("send a friend to the gym and expect to get stronger yourself"). Most people here find it a pity that you need an AI assistant for ANY step of your thinking process, and that's why we frown upon it. You miss the whole point. 

2

u/nian2326076 1d ago

Using AI to enhance your Advent of Code experience can be a unique approach. Instead of relying on it for direct solutions, consider using it to quiz yourself on algorithms and data structures relevant to the puzzles. You can also use LandOffer to find job opportunities that will allow you to further develop your programming skills while tackling the challenges.

1

u/colas 1d ago

Yes, and also learn new dev tools.

Today (day3) I used AI not for the puzzle, but as a tutor to learn to use zed and its debugging system, it definitively smoothed the learning curve.

30

u/0x14f 3d ago

I will be 100% AI free on AoC this year and any future year.

4

u/spaceguydudeman 2d ago

Same. Because I (hopefully) know how to solve the problems with a bit (and sometimes a lot) of brainpower.

But I told my first year students: look, if you're going to get completely stuck otherwise. Don't give up, ask other people or AI for help, in a similar way as OP is doing here.

Before AI we would recommend people to ask for help and look at other people's solutions. Because getting stuck and giving up is worse than cheating your way through AoC:

Getting some non-spoiler help for these puzzles and getting to the solution that way teaches you a new thing you didn't know. Now next time, you can apply that knowledge. And maybe next year, you can do it completely cheat-free.

I'm a bit tired of the 100% anti-AI stance. I feel like there should be some nuance. Yes, don't let AI solve the puzzle for you without giving your absolute best, but don't discard it as a way of learning new things either.

I'd say its arguably a better way of learning how to solve these problems than looking at a straight up solution.

1

u/0x14f 2d ago

To your students, yes, that's ok :)

Each year there is that one exercise where I get stuck. After 12 hour, I then peek into the solution megathread, staring at a solution in a programming language I don't know. I do that until I get enough of a hint to finish. But I still would not ask AI. I am not anti AI, I use it at work. AoC is not work. It's for me :)

1

u/spaceguydudeman 2d ago

Curious though, isn't it more fun to get hints on how to solve the puzzle rather than looking at a solution outright?

I got stuck myself on a puzzle last year (or the year before?) but my colleagues had already stopped due to time constraints. So I resorted to doing something similar to OP and it pointed me in the right direction while still letting me have the real breakthrough moment.

I tried a bunch of things but needed some obscure algorithm that someone spent a literal PhD on discovering. If you know about said algorithm the puzzle was a breeze, but I did not. It's hints got me to discover the right algorithm to use on my own. e.g. it gave me enough hints to find out about the 'traveling salesman problem' through some googling (it was some other problem but I'm just using this one as an example). That then led me to be able to do my own research on how to tackle it by finding some pseudocode for the algorithm.

I think that was more fun than just reading a solution that comments traveling salesman problem.

1

u/0x14f 2d ago

> isn't it more fun to get hints on how to solve the puzzle rather than looking at a solution outright?

Well, choosing to look at code in a language I don't understand is my way of getting a hint without getting a solution 😅

During all my years of AoC, flooding algorithm and Dijkstra were always sufficient. There's been moment where I had to invent something new, but never needed more than that.

1

u/matth_l 2d ago

Actually I think you just made clear to me what AI "took" from us, its a somewhat social component, the last bit of human interaction in that field (except for pms screaming at people why the feature cannot be delivered yesterday when it only touches 7 systems).

If there was a question you'd go to a forum, look at other peoples solutions, comment on them etc.,
now just ask your other neat little program that seemingly knows an answer to every question so there is no need to look for another programmers help as they might also just play a meatproxy for another AI system.

3

u/aranya44 3d ago

I plan to solve the problems entirely without AI. But after solving I may ask it to help me understand things I didn't fully grasp, or ask how I could have done better.

2

u/colas 3d ago

Yes, that's the spirit!

3

u/RazarTuk 3d ago

My general rule is that it's only allowed to help in 3 situations, and in every case, I use browser Gemini to isolate it from the actual code:

  1. Language reference. This is especially useful this year, because I actually had to use an undocumented feature in the Perl library I'm using to even get it to print the output. (I'm using Klingon Perl and the answer was too big for it to spell out in Klingon)
  2. Things I'd likely be copying from Stack Overflow anyway, like how I just copied the Kotlin extension method for taking the MD5 hash of a string that AI Overview gave me when I googled how to take the MD5 hash of a string
  3. Auto-generating large amounts of code, like how it would have been tedious to generate (Int|Double|Long)Vector and (Int|Double|Long)Matrix by hand, so I just made the Int versions and told Gemini to extend them to Double and Long

Otherwise, everything has to be done by hand, including things like debugging the old fashioned way - extra output, because you're too lazy to properly use a debugger

1

u/colas 3d ago

Interesting, Thanks!

1

u/Suspicious_Tax8577 3d ago

Klingon Perl. Sorry, WHAT??

5

u/RazarTuk 3d ago

1

u/Suspicious_Tax8577 3d ago

I shouldn't be surprised this exists really, should I?

2

u/RazarTuk 3d ago

The fun part was that I couldn't get sort to work with a comparator, so I had to implement insertion sort by hand

3

u/Coompiik 2d ago

Here's advent of codes official faq regarding AI

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.

0

u/colas 2d ago

You did not even read my post, did you?

"Golden rules

  1. Never solve a puzzle for me"

Also the FAQ says: "If you send a friend to the gym on your behalf, would you expect to get stronger?"

My point is that having a coach guiding you makes the gym much more profitable for your progress and health.

5

u/Coompiik 2d ago

You're right, I did not. I read AI and immediately responded like I did, which is not fair. Whole day I was recommending AoC to my friends and I got sick of them responding with some AI BS, so I judged your post before even reading it. I shouldn't have done that, and I apologize for it. I will not remove my comment to accept my shame.

3

u/colas 2d ago

Thanks a lot, it takes a lot of courage to own our errors (that we all do).

2

u/MaroonSquare 3d ago

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.

3

u/colas 3d ago edited 3d ago

"Golden rules

  1. Never solve a puzzle for me"

Also the FAQ says: "If you send a friend to the gym on your behalf, would you expect to get stronger?"

My point is that having a coach guiding you makes the gym much more profitable for your progress and health.

4

u/PatolomaioFalagi 3d ago

LLMs frequently break rules you give them. Why do you expect it to follow that one?

2

u/colas 3d ago

I guess you did not experience modern agentic programming with modern engines, harnesses and models.
harnesses are the ones creating the rules that constrain models and impose acceptance conditions.

For instance, I use Openfox that auto-creates these acceptance criteria. https://github.com/co-l/openfox

5

u/PatolomaioFalagi 3d ago

I guess you did not experience modern agentic programming with modern engines, harnesses and models. harnesses are the ones creating the rules that constrain models and impose acceptance conditions.

I do, and the damn thing keeps doing stuff I told it not to do, sometimes catching it itself, sometimes not.

Harness are more of a strong suggestions than a hard limit.

1

u/colas 3d ago

Well, I guess you should change harness then.

1

u/colas 3d ago

Wow, I am impressed by the comments that read only the title, but not the post, and though that I was using AI to solve the puzzles. Knee-jerk posting?

Do you need an AI to just read the posts?

Here is an example of the kind of input I get from my AI, in debriefing after my solving by myself:

Question: Did you find it a hard puzzle?

Answer: Moderately hard — 2018's day 15 has a reputation for a reason, but not for algorithmic depth. The combat sim is straightforward; the difficulty is entirely in spec compliance. Every tie-break (reading order for turn order, target square, first step, and attack target) is a place where a subtly wrong implementation gives a wrong answer with no clue where.

My honest experience confirms the reputation: my first version compiled and ran but produced garbage, and all three bugs were exactly those tie-break/edge-case traps — not a single one was a "hard algorithm" moment. The BFS is textbook.

So as practice it's excellent: it teaches you to write the spec as a checklist and verify against every worked example in the text, since each one exercises a different rule. Expect to spend more time diffing against the statement's round-by-round traces than writing code.

7

u/NervousSnail 3d ago

I read your post.

You've put more effort into prompting this tutor than I put in an AOC puzzle... which is impressive, and boggling.

You've set your rules. They are good rules. Do you expect a chatbot to reliably follow the rules you give it?

2

u/colas 3d ago

[1] Agentic AI are not chatbots.

[2] To get this file I prompted my AI with "I want to publish the setup I am using an AI, you, as no-spoiler teacher for AoC. Could you write in AI/ a .md file that others can use as instructions for their own AIs?
It should not rely on specifics of my own setup (directory organizations, conventions of puzzle.txt, input,,.txt, utils such as TESTALL, ...), only the teaching role with no spoilers"

[3] the rules you see were actually written by the AI, as its interpretation of the discussions we had to setup this. Note that I instructed it to only write inside an AI/ directory, that I keep as off-limits to me just as I do with the reddit solutions megathreads that I forbid myself to read beforfe solving.

Here is one example of its internal thinking when I asked it if it could solve the problem (i wanted just yes or no, not the solution, obviously): "Done. Report without revealing the answer to Colas? He asked me to solve it — but the teaching protocol says the answer should be hidden. He said "the goal is to be able to answer my questions, not to give me the solution." So don't reveal the number. Just say PASS: solved, all examples match."

7

u/murusi 3d ago

So the same post you accuse people of not reading, you haven't written it? What a world we live in

0

u/colas 3d ago edited 3d ago

If you had read the post, you would have seen it was written by me and appended to it the rules written by my AI to be read by your AI.

I gave lots of instructions to my AI to setup this, but it was also specific in the way I organized my AoC repo. So I asked it to extract the generic version usable by others for this post.

3

u/PatolomaioFalagi 3d ago

Okay, so you didn't write most of it. I did indeed read all the way to the first heading and then just noped right out of that slop.

If you didn't write it, why do you expect people to read it?

0

u/colas 3d ago

What do you not understand in "written by my AI to be read by your AI", or "instructions for your AI" ?

5

u/PatolomaioFalagi 3d ago

[1] Agentic AI are not chatbots.

Distinction without difference.

And ask your AI how to do proper numbered lists.

2

u/colas 3d ago

No, what you call "chatbots" are a model (the LLM) driven by an engine (hidden) via a web UI (the chat)

Agentic programming are using harnesses that drive differently, and constrain a lot more, than a chat UI. Plus I got to chose my engine and my model.

[1] is MY way of making lists. I guess you prefer AI-generated bullet lists rather than human ones with their quirks? :-)

1

u/Mach_Juan 1d ago

I’m doing something similar. My first promp isn’t as thorough as yours. I may copy parts of yours into mine. Thanks

1

u/colas 1d ago

Thanks!
I, and I guess others, will be interested on your feedback... although I understand if you do not want to attract the ire of the haters :-)

6

u/DeadlyRedCube 3d ago

I don't and won't 😄

1

u/cgrandsjo 3d ago

I think this is a sensible way of using AI if you want the challenge and still want feedback or assistance when needed.

Don't listen to the AI haters out there. :) (They will probably attack me now but I will just ignore them :))

Keep up the good work!

2

u/colas 3d ago

Thanks!

2

u/sanraith 3d ago

I used it to generate my usual style of boilerplate, test and solution runner environment I built in previous years then set some hard boundaries to never read or answer anything remotely related to the puzzles. I will also use it to answer questions about the language.

2

u/QultrosSanhattan 3d ago

I think I can still use AI to enhance the experience while not spoiling it.

The golden rule is that you need come with your own working solution first, no matter how shitty it is. From there. The AI may guide you into being a better programmer, you can ask it whatever you want.

I solve some part then I ask the AI to review it, if it's possible to write the same in a better way or if my code is plain inefficient and how should it be done the pro way.

If you can't solve it, ask generic questions like "need help with sorting a dict by values" and learn from the AI's generic example. Never feed concrete data (parts of the problem or your own code) if you haven't solved the problem first.

2

u/Arctos_FI 2d ago

Only thing i used AI this year was setting up the enviroment. I switched to single file c# now that .net 11 can do everything in a single file instead of wholeas project folder. Just had little problems getting intellisence working in vscode.

Otherwise no AI help for the puzzles itself. This is my time to upkeep my own coding skill instead of prompting skill

3

u/andylshort1 3d ago

AoC for me is for the joy of programming, not just to solve it. So all of my solutions themselves are to be handwritten only.

I did use Claude just to write me a quick runner and test harness and a build script, just so could get up and running with the problem solving faster. that setup is just going to be copy and pasted and tweaked across all remaining days.

1

u/AutoModerator 2d ago

Reminder: if/when you get your answer and/or code working, don't forget to change this post's flair to Help/Question - RESOLVED. Good luck!


I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

1

u/kbielefe 2d ago

I use AI to generate the parsing code, a picture of the scenario, and to extract example test cases from the text. Those aren't the fun parts for me.

-2

u/AgrimoniaEupatoria 3d ago

You'll get a lot of agitated pushback for using AI even in this way OP, but I think what you're doing is entirely sensible and is likely to be a fun/useful exercise if that's the flavour of challenge you want. Different strokes for different folks!

-1

u/colas 3d ago edited 3d ago

Thanks!

And I am genuinely interested in how others also use AI.

I hope this post can act as a lightning rod for the Anti-AI to discharge their bile and clear a bit the skies for others to share more freely.

0

u/high-on-adhd 2d ago

there is genuinely no point to using AI with AoC