Learn creative coding writing simple programs

31. Function parameters and return values

This episode is a bit more serious and less visual, but it will be important to know how to create your own functions.
We create a simple function that does not take any parameters, and another that takes two numeric parameters and adds them together. We also create a function that returns a value.
Knowing this we will be able to simplify the program we created in the previous episode with four rotating rectangles.


Code editor

You can make changes to the code below. Then
Below you can ask and answer questions related to this video. If your question is unrelated to the video, please post it at the Processing Forum as I'm unable to help with all of your programs and still have enough free time to eat and sleep :)
comments powered by Disqus