Pixel effect, how do you create this effect

We all have to start somewhere!

If you want to learn from an AI you need to train it first to work with your intended workflow “otherwise it does all the work for you, producing errors, inefficiencies, and bloated code”. < I asked ChatGPT to phrase that last part about code it generates!
You also need experience with prompting and customizing an AI along with programming experience to scrutinize the results.
This is beyond the scope of this topic or forum.

The AI generated code you cut and paste feedback:

  • formatting could be improved; lots of blank lines
  • it is not runnable and has extra \ (back slashes) that need to be removed
  • it has some advanced AI generated (assuming) code; ChatGPT even said it is not a good Java version and made recommendations!

A simple random function can also provide sufficient distribution of values across the range.
Add a randomSeed() and it won’t change.
If the deterministic hash code is desired that can be added later.
That hash function is cool code and I spent the morning researching it!

This is achievable with the concepts I provided and without an AI generating the complete code.

KISS < Keep It Super Simple and learn to code from the ground up.
You need to build a strong foundation and then build on that.

I encourage you to read the Welcome to the Processing Foundation Discourse and the Guidelines that are linked:
Welcome to the Processing Foundation Discourse

Lots of good stuff in there for someone new to Processing and this Community.

I am trying to help!
Honest feedback is always good and will make you a better programmer.

:)