# OpenAI's ChatGPT is writing Processing sketches

**URL:** https://discourse.processing.org/t/openais-chatgpt-is-writing-processing-sketches/39963
**Category:** Teaching
**Created:** [December 1, 2022, 12:47pm UTC](https://discourse.processing.org/t/openais-chatgpt-is-writing-processing-sketches/39963 "2022-12-01T12:47:27Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![josephh](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/josephh/32/210_2.png) [@josephh](https://discourse.processing.org/u/josephh)
#### Post date: [December 1, 2022, 12:47pm UTC](https://discourse.processing.org/t/openais-chatgpt-is-writing-processing-sketches/39963/1 "2022-12-01T12:47:27Z")

</div>

Hi everyone,

I just tried the new [ChatGPT Chatbot](https://openai.com/blog/chatgpt/) from OpenAI and it’s just mind blowing! 🤯

Here are some examples with Processing!

 ![Screenshot 2022-12-01 13:31:55](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/3X/8/0/80d4cf361b52830725c4312939f5497c1d7ff044.png)

Here is a more complex assignment with squares at random position / color and size:

 ![Screenshot 2022-12-01 13:34:54](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/3X/3/9/3900d321a0c6b17d5f73a63bdc3f751edd49ec5a.png)

And even asking about p5js and a dithering effect!

 ![Screenshot 2022-12-01 13:40:27](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/3X/0/b/0b1226d9b75e4edb4db636cf6dc4606a050f5090.png)

As you can see this is far from perfect, some examples doesn’t work out of the box or the AI misunderstand some concepts or the logic (the random squares rectangle only set the random color in the `setup()` function, a common beginner mistake! 😉 )

And asking for full examples or harder algorithms doesn’t work well (and it’s fair since having that deeper knowledge is difficult)

This is still amazingly good and maybe in the future people will use that to do their Processing homework ahah? 😅

I like the fact that the AI was probably inspired by forum posts on Processing because it even adds the “I hope it helps!” sentence at the end and suggest to look at the reference and documentation. Sweet! ❤ ❤

What do you all think about that?

---

<div class="post-metadata">

### Author: ![josephh](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/josephh/32/210_2.png) [@josephh](https://discourse.processing.org/u/josephh)
#### Post date: [December 1, 2022, 12:56pm UTC](https://discourse.processing.org/t/openais-chatgpt-is-writing-processing-sketches/39963/2 "2022-12-01T12:56:27Z")

</div>

Just for fun, here is the AI trying to solve a real forum issue:

 ![Screenshot 2022-12-01 13:54:33](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/3X/1/c/1c6a9b532ea951ca4ebb8d0012175718ff052cbb.png)

> [@'Scaling' the canvas?](https://discourse.processing.org/t/scaling-the-canvas/39909):
>
> Hello Is it possible to scale/change the resolution of the canvas in p5.js to create pixel type games? For example, to create a canvas which is 640x640 but will only display 160x160 ‘pixels’ (each being 4x4 actual pixels)? TIA Paul

---

<div class="post-metadata">

### Author: ![sableraph](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/sableraph/32/251_2.png) [@sableraph](https://discourse.processing.org/u/sableraph)
#### Post date: [December 1, 2022, 1:45pm UTC](https://discourse.processing.org/t/openais-chatgpt-is-writing-processing-sketches/39963/3 "2022-12-01T13:45:12Z")

</div>

We’re not ready to be replaced _quite_ yet but this is very impressive!

Now try asking a stereotypical pirate to help you with your Processing sketch 😆

> <https://twitter.com/memotv/status/1598253038485274624?s=20&t=onV2Z6PB2mdMxMR1-Bi9PA>
