Lesson 9: Further Functional Abstraction

In the eighth lesson, we put our function to draw a single curve stitch into another for loop in order to draw an 8-pointed star. Now we are going to take that for loop and put it into another function in order to be able to easily draw and redraw that 8-pointed-star pattern wherever we want it.

Notice how, by now, we've probably already forgotten the details of how we drew a single curve stitch in the first place! We've abstracted that problem out into a function, and we don't need to remember those details; we can now start thinking in terms of a complete curve stitch and/or star pattern as our basic building blocks!

Hopefully you've started to get a feel of the power of VARIABLES, LOOPS and FUNCTIONS in order to be able to combine simple bits of code into more and more sophisticated products. Variables, loops and functions are the lego blocks of programming. Once you know how to use them, you can build pretty much anything by starting simple and combining these building blocks into something more and more elaborate.