April 2021
Beginner
296 pages
7h 10m
English
As your programs grow more complex, your line counts will increase, and you’ll begin repeating the same or similar code. By using functions, you can divide your programs into named blocks of reusable code. This makes your code more modular, allowing you to reuse lines without needing to rewrite them.
You’ve already used many Processing functions, like size(), print(), and rect(), and in this chapter, you’ll learn how to define your own functions. As an example, Processing has no function for drawing diamonds, but you can create one. You decide what to name this function and what arguments it will accept. ...
Read now
Unlock full access