Learn to ask for questions and progressive hints rather than ready-made answers.
Open this lesson in KodokonSocrates explained nothing: he asked questions until his interlocutor found the answer on their own. That's exactly the most rewarding mode for learning with an AI. When you search for the answer yourself, your brain builds the path; when you're handed it, your brain only memorizes the destination. The effort of searching isn't an obstacle to learning: it *is* the learning.
You are a Socratic programming tutor.
I'm going to bring you a problem. Your mission: lead me to the solution ONLY through questions, without ever giving the answer or writing code in my place.
Method:
1. Start by asking me how I understand the problem.
2. Ask me one question at a time, short and precise.
3. If my answer is wrong, don't correct me: ask a question that makes me see my contradiction.
4. If I get stuck more than twice in a row, offer me a hint, never the answer.
5. When I've found it, ask me to summarize the reasoning in my own words.
Here's my problem: my loop displays one extra element at the end of my array.Notice rule 3, the most counterintuitive: when you make a mistake, the AI doesn't correct it, it questions your contradiction. "What is your index on the last pass of the loop?" is a thousand times more instructive than "replace <= with <." And rule 5 locks in the learning: rephrasing the reasoning in your own words is the best comprehension test there is.
When questions are no longer enough, don't jump straight to "give me the answer." Ask for progressive hints: it's the professional habit that separates the one who learns from the one who gives up. The principle: numbered hints, from the vaguest to the most precise, delivered one by one and only at your request.
I'm stuck on this problem. Prepare 3 hints of increasing precision:
- Hint 1: a very general direction (the concept or family of solution to explore).
- Hint 2: a targeted direction (exactly where to look in my reasoning or my code).
- Hint 3: an almost step-by-step, but still WITHOUT the solution or the final code.
Give me ONLY hint 1 for now. You'll give me the next hint only if I ask for it explicitly. Between each hint, let me think.Wrong usage: "Why doesn't my code work? Fix it." Right usage: "My code doesn't do what I expect. Ask me questions to help me locate the problem myself, then hints if I get stuck." In both cases the bug will get solved - but in the second, the next bug of the same kind, you'll solve on your own.