Skip to content

Creating Your Own Functions with mBlock

One of the key foundations of Computational Thinking is the idea of abstraction. Abstraction is where you take a much of complex code and create a wrapper that hides the complexity of the code. This makes it easier for other people to reuse your code blocks!

Just like Scratch, mBlock allows us to create our own functions. We can give each function and name and then call it by that name anyhere in our code.

We can also send our new function parameters so that it can customize the behavior based on what we put in a parameter. So for example we can create a function called "turn and move" and give it how many degrees to turn and how far to move forward.

Sample Program

TBD