Sa(i)tanic Coding!

Whaaaaaat? Is coding now a satanic ritual? Of course not, but what about AI? GenAI is on the rise and has already made it’s way to software development. Wether it is ChatGPT or GitHub CoPilot. Let’s have a tiny look at both of them.

What is ChatGPT? Well, lets ask this question ChatGPT:

So let’s find out what is happening if we want ChatGPT to write some code 😉 We want to have, obviously, an inverted pentagram. If we ask Google for a picture we get…. what else… a pentagram with one edge pointing downwards.

So now lets ask ChatGPT to draw an inverted pentagram with the help of python. In this case we use ChatGPT 3.5 with a very easy prompt.

On the first sight the code looks quite decent. We can see the background set to “black” and the lines (pencolor) to “red” as requested. There is a for-loop to draw the five lines, but the line “pentagram_turtle.right(144)” indicates me, that this will be a regular pentagram.

So I asked ChatGPT to correct it’s “mistake”.

On the first look, this one looks exactly like the first result, but it’s not. The tiny change was to let the turtle move backwards and alter the starting point.

Let’s see what copilot is doing with same request.

The result looks quite similar to the one produced by ChatGPT. Colours are correct, five lines and we have the same algorithm for the movement for the turtle….yep… a regular pentagram.

So I asked CoPilot as well to make it upside down….but:

The same result, only the starting point of the turtle has changed, the pentagram is still the same.

Tiny conclusion: The code is runnable in both cases, ChatGPT was able to correct it’s mistake. Maybe drawing pictures with a programming language is not the right approach to test the capabilities of GenAI for coding.