Can someone help me with this code?
in
Programming Questions
•
1 year ago
Hello all,
This post is about an individual exercise I have to do for Processing at school. However, I can't seem to work it out after several tries. They seem rather simple for those who get Processing. I can't seem to find a good start though.
If someone could lend me a hand on doing these or finding the right functions I need, many thanks! Due to personal problems I haven't had time to do these so I've got to finish them before tonight. If anyone could help me, or create them for me and tell me how they've done it, this would extremely help me!!!
Here are the three exercices (they're originally written in dutch so please say so if I'm not clear in my explanation):
A.
Create a program that has a function that gives an output that exists out of the first ten numbers of the math table.
For example: if you input the number 3. The output will be the table of three (1x3, 2x3, 3x3, 4x3 etc.).
B.
Create a program that consists out of a new image (PImage) with the size of 200 x 200 pixels, which gets automatically colorized with a random color for each pixel. It has to have a dark gray background that isn't visible cause of the colorized randomness.
There are tips given for this exercise which I don't get:
Tip 1: Use a FOR-loop to input the colorvalue per pixel. It has be linked to the length of the pixel array of the image (image.pixels.length)
Tip 2: Use loadPixels and updatePixels.
C.
Create a program that consists out of a new image (PImage) with the size of 200 x 200 pixels, which, before it is being shown on the screen, gets colorized entirely white. Each time that the mouse cursor goes over a pixel in this image, this pixel has to become darker untill it's black. If the pixel is entirely black, the sketch becomes entirely white again, so the program "restarts".
Any help will be much appreciated. Thanks!
1