Blockly coding tasks
This type of task is very flexible: Task authors can set problems where a variety of solutions can be given credit for producing the correct answer. These tasks use Function blocks and take this form:
Try writing this code into the function in the workspace below.
This function now adds the values in the variables b and c, adds them and returns the sum. Run the program to see how this works.
Try this out in a new window ...
Recommended practice
Functions, Procedures and Subroutines
Example 1
Example 2
Example 3
Example 4
Did you know the UK Bebras Challenge is run by the Raspberry Pi Foundation? Discover free teaching resources, tools, and expert support for computing education at raspberrypi.org.