Giving our Bee Bots instructions to achieve a goal
Checking to see if our instructions worked
Year 4 - Coding with loops
Year 4: What have you been learning about in coding?
Year 5 - Coding with functions
Before beginning our Coding, Year 5 learnt what functions are and how they can help us.
Bill Gates explained that functions are a way that we can program pre-existing algorithms that are used more than once. By doing this, it can save a lot of time as we don't have to rewrite existing code again and can make our programming more efficient.
Year 5 used real life examples which are repeated daily - such as brushing our teeth or opening our books and writing the date and learning objective - to show that in a similar way, our brains use functions. Once we know how to do a certain task, we can perform them as a habit or routine without even thinking.
After writing some of these real life functions as a whole class, Year 5 began coding with them.
They had to write the algorithm for drawing a square or collecting nectar for a bee, and then used these same algorithms as a function to repeat the action without rewriting the code all over again.
Take a look at the photos and videos below of both 5TD and 5AG using functions within their coding!
Year 5 have been coding using functions, but what is a function?
Functions
Year 5 - Coding with Functions
Coding with repeated algorithms
Year 5 starting their journey of using functions!
Here the children can be seen writing the code for two equal squares separated by 75 pixels. They had to recall their knowledge of loops from Year 4 (seen as the pink blocks within this image) to repeat the drawing of identical angles and sides 4 times.
After this, they moved onto using a function for recalling algorithms which they had previously used, so that they didn't have to rewrite the same code over and over again. Pretty efficient coding!
Using functions
Year 5's first attempt at using functions to program previously used algorithms.
The input of a function can be seen as the green blocks, whilst the algorithm for that functions can be seen at the bottom as a separate piece of code.
If you look closely, you will notice that this is a very similar to the activity in the video above this once, however uses functions to ensure the children's coding is even more efficient.
Using functions
After creating an algorithm for drawing a square, 5TD and 5AG had to apply this to a function so that they could repeat the input in a more efficient way.
Coding functions
After creating an algorithm for drawing a square, 5TD and 5AG had to apply this to a function so that they could repeat the input in a more efficient way.
Using functions
The children applied the function block (green blocks) to reuse a piece of code that they had already used in a previous algorithm.
Editing functions
Adapting or editing previously used functions to achieve a new goal. Here the Year 5s adapted a previously used function - drawing a regular quadrilateral - very slightly to draw a new shape - hexagons. They had to use their knowledge of angles to ensure that the function would draw a shape with 6 equal sides rather than 4.
Adding in individual steps to debug and explore where our algorithm is incorrect
By working one step at a time, Year 5 were able to gradually work towards achieving their goal; they were able to see which parts of their algorithm were accurate and then debug and adapt their code if things went wrong.
Checking completed algorithms
Here the children can be seen 'running' their completed algorithms to check if they were precise and achieved the intended goals. The Year 5s had to combine their knowledge of loops (pink blocks) which they learnt in Year 4, with their new understanding of functions. Impressive coding everyone!
Year 6
When starting their coding teaching sequence, Year 6 began by 'paper' and 'concrete coding'. This is where an algorithm is written and then physically acted on, rather than programmed into a computer. By doing this, the children were able to understand that an algorithm is actually just a set of precise instructions.
Top
Cookies
Unfortunately not the ones with chocolate chips.
Our cookies ensure you get the best experience on our website.
Please make your choice!
Cookies
Some cookies are necessary in order to make this website function correctly. These are set
by default and whilst you can block or delete them by changing your browser settings, some
functionality such as being able to log in to the website will not work if you do this.
The necessary cookies set on this website are as follows:
Website CMS
A 'sessionid' token is required for logging in to the website and a 'crfstoken' token is
used to prevent cross site request forgery.
An 'alertDismissed' token is used to prevent certain alerts from re-appearing if they have
been dismissed.
An 'awsUploads' object is used to facilitate file uploads.
Matomo
We use
Matomo cookies
to improve the website performance by capturing information such as browser and device
types. The data from this cookie is anonymised.
reCaptcha
Cookies are used to help distinguish between humans and bots on contact forms on this
website.
Cookie notice
A cookie is used to store your cookie preferences for this website.
Cookies that are not necessary to make the website work, but which enable additional
functionality, can also be set. By default these cookies are disabled, but you can choose to
enable them below: