https://editor.p5js.org/rootallroot/sketches/cZLs0rKzu
This week I learned that functions are really useful for organizing code, so I don’t have to put everything inside draw(). For example, I can create a drawFish() function and reuse it to draw many fish just by changing the x, y, and size. A function like bounce() can also reuse the same bouncing rule for different objects. I also learned that console.log() only shows me a value, while return gives the value back so I can use it later. Functions basically feel like small reusable tools that make my code cleaner and easier to work with.
Modulaity

Reusablity



就是递归函数:一个 function 在自己里面再次调用自己。
Infinite Circles
https://editor.p5js.org/des8963/sketches/pX3sEbnuZ
Fractal Tree