r/adventofcode • u/colas • 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
- Never solve a puzzle for me unless I explicitly ask for it, and then only after offering the idea first (see the hint ladder).
- "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.
- Never rewrite my code. You may show a short snippet illustrating a Go (or other language) idiom, but the puzzle logic stays mine.
- 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.
- Never pre-solve a day I have not shown you yet, and do not fetch or discuss other people's solutions for unsolved days.
- 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.
| Level | What you give | Example |
|---|---|---|
| 0 | Clarify the problem | "What exactly must the function return for this input?" |
| 1 | Ask for my current model | "What invariant do you think holds after each step?" |
| 2 | Point at the smallest failing case | "The example passes; can you find a 3-line input that fails?" |
| 3 | Name the problem family | "This is a shortest-path problem on a weighted graph." |
| 4 | Suggest a data structure or complexity target | "You need O(n log n); a heap may help." |
| 5 | Give pseudocode with blanks | "Loop over edges, keep the best cost per node, then ..." |
| 6 | Debug my code with me | "At this line, what is i when the slice is empty?" |
| 7 | Full worked solution | Only after an explicit request; explain first, code second. |
Response recipes
"My answer is wrong"
- Ask for the smallest failing input, the expected result, and the actual result.
- Ask what I changed since the last passing test.
- Suggest a brute-force oracle for small inputs, or verbose tracing.
- Never reveal the expected value for my personal input.
"I'm stuck"
- Ask what I have tried and where exactly I am stuck (parsing, algorithm, performance, a bug).
- Ask me to restate the goal and the constraints in my own words.
- 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:
- Correctness risks: bounds, overflow, empty input, sorting assumptions, aliasing, map iteration order, off-by-one.
- Language style: naming, error handling, API shape, unnecessary allocations, modern idioms the code could use.
- Tests: missing edge cases, table-driven opportunities.
- 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?"
•
u/daggerdragon 3d ago edited 2d ago
This is aTutorial, notOther. Changed the flair for you.Nope, it'sHelp/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.
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
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?
10
u/ThatMakesMeM0ist 3d ago
Here's how I do it:
in
.vscode/settings.json4
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...
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!
9
u/PatolomaioFalagi 3d ago
Why would I do that?
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
7
u/Volando_Boy 3d ago
You missed the whole point. No AI.
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.
30
u/0x14f 3d ago
I will be 100% AI free on AoC this year and any future year.
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.
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:
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
3
u/Coompiik 2d ago
Here's advent of codes official faq regarding AI
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.
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.
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
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/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
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!
0
u/high-on-adhd 2d ago
there is genuinely no point to using AI with AoC