Patterns
A pattern is something that repeats in a predictable way. ⭐ 🎉 ⭐ 🎉 ⭐ 🎉 — what comes next? A star! Patterns are like loops!
What Is a Function?
A function is a named group of instructions you can use over and over. Instead of writing the same steps 10 times, you make a function!
Give it a name, like drawStar(). Whenever you need a star drawn, just call that name!
💡
Functions are like recipes!
A cookie recipe is a function! You write it once and follow it as many times as you want!
Functions Save Time
Instead of writing "draw a house" steps 5 times (20+ lines!), you write a drawHouse() function ONCE, then call it 5 times. Much easier!