Sunday 26 July 2015

Using Lists with Scratch

My class have previously used lists in scratch to create adventure games where the player selects an appropriate item from his/her inventory to solve certain problems. This was nothing too complex: choosing between a banana, a key, a telescope and a piece of wood when faced with the problem of a locked door. Recently I have been looking at how lists can be used in a cross-curricular way and came up with the following idea in maths.

To start off, the children created a variable called random number. Then they wrote a program to make the variable a randomly selected number between 1 and 100 and for the sprite to say the variable. Next we discussed how we could award points based on the properties of the number. The class generated ideas (primes, squares, factors of x, multiples of x,) and then used probability to decide which number property should have the most/least points..

The next step involved children creating each list (based on the aforementioned number properties) and adding the appropriate numbers to these lists. Once this was done, children wrote an algorithm, then a program that checked the random number variable against each list and awarded the appropriate number of points. Some children took it a step further and added a time limit and high score functions to their program. The scratch file that I used to introduce number property lists to the children is available here. Below are screenshots of a pupil's example.