I’m recording my interactions with OpenAI ChatGTP to solve advent of code, here is some context.
I ask it to solve a problem, but hit the enter key too early, without giving the problem.
It gave an answer anyway. Obviously it didn’t solve our problem. We can notice that the program works, and actually solve the problem “sum the numbers in a file, each number in one row”.
Adding the real problem
So I put the real problem (screenshot is cut, real puzzle is here):
And the answer:
Funny thing, it give context and explain a bit what the program is doing.
But, unfortunately, the program doesn’t give a valid solution. After reviewing the code, I see that it’s considering the first value of each group as the name of the group, but there is no name only values. Let’s give it this information…
Here we see one of the ChatGTP’ strength , the ability to remember the conversation.
After a quick review, I noticed that it understood that it had to change elf, the program is almost doing it but the issue is that the part where it want to change elf, it take always the same name “Elf”.
This time, the program gives the correct answer!
Let’s try the direct approach
Well, it worked directly, nothing to add!