Will ChatGPT replace Google developers? (II)
After solving the first of the problems of Google's programming challenge using ChatGPT, I moved to a new level that includes two different problems.
The problems of this level seem to be easily solved with the use of programming algorithms that any experienced developer should know and that libraries already created in Java help to apply. But I'm not a programmer, I don't know these algorithms and I can't ask ChatGPT to apply them, so I must trust that it will do it autonomously. Here I think that a programmer giving clear instructions could improve the answers and the time until it had the right one.
The problem is: given an 8x8 matrix with squares numbered from 0 to 63, indicate the number of moves a chess knight must follow to go from a square ‘x’ to a square ‘y’.
Easy, isn't it? Will ChatGPT be able to understand the problem and find an optimal and fast solution by using some of the algorithms that an experienced programmer would use?
Foobar Level 2 exercise 1: Dont get voluntaree
Result: ChatGPT did it again!!.
Time provided by Foobar to code the exercise: 7 days
Time that ChatGPT “and I” needed: 2 hours. So much time for this problem, but I did this exercises with the ChatGPT first version that didn't have the history functionality, and each time that it returned a congestion error I had to start from the beginning.
The text in the first question is a copy-paste of the problem statement.
And this time, ChatGPT answer with an error message…
Checking in Internet I found that sometimes ChatCGT returned an Network error when the output is so long, so I asked it to provide only the code, without its explanation and comments.
Checking this code, it seems that it is not valid for all the tests:
So I asked for a new version of the code. As I did in the previous article, I didn't want debug the code to check what was the problem, just ask for a new version and test it (This debug is something that I will do in next exercises because without this debug, chatGPT wont able to find the correct answer. But this is something that we will see in next articles)
Hovewer, when I verified the code…
It failed all the tests!! Thinking about it, it didn't have so much sense if the code was tested by GPT. So I thought that maybe there was a compilation error, or I was missing some of the rules.
And checking again the instructions, I found this:
"Third-party libraries, input/output operations, spawning threads or processes and changes to the execution environment are not allowed"
So to avoid any issue with the LinkedList class I introduce this command in ChatGPT:
And crossing the fingers….
Well done ChatGPT!! And the best part is when I asked it for a description of the solution:
So yes, it was able to use a well know algorithm to find the solution to the problem.
Let's see what happen with the next problem…