Hello @beginn,
Take a step back before taking a step forward.
What’s first?
Read and follow the guidelines listed here before posting and asking questions:
Welcome to the Processing Foundation Discourse
Know what resources are available to you.
The Processing website is a good start and has tutorials, references, examples here:
https://processing.org/
Next?
Break it down into steps.
First and foremost learn and understand each point that is asked (you can do a search on site above for each of these):
- array
- loop
- random
Once you understand each of the above take the next step and piece it together.
The odd indices may be a challenge for a beginner. Seek and you shall find.
Another reference:
Creative Coding for Beginners - Full Course!
I linked it to what I consider good advice for a beginner… be sure to start at the beginning.
After all that is said and done try to write the code from scratch to reinforce the concepts you have learned.
:)