Um, so given the phrasing of your post, you do understand that you are asking us to do your homework for you right?

The forum’s homework guidelines here:
“Our goal is to give you starting points and to help you break down problems and learn how to solve them for yourself – not to do your homework for you!”
And here:
https://discourse.processing.org/faq#homework
We can help you if you share what YOU currently understand and specifically point to areas in the code you need help with.
