Coding for Life

The post below is a selection of learning activities from a new iTunes U course that Aspect Hunter School colleague Heath Wild and I have put together for Hour of Code. It is called 'Coding for Life'. Our focus for the course is for it to be student driven, with a focus on students understanding coding as a way of understanding their own thought processes better. We have developed a sequence of lessons that take students through activities that teach them about better understanding their own daily routines and task analysing daily activities such as brushing teeth and packing a school bag, through offline coding activities that take coding into the garden, into Lego and music exploration, then onto iPad coding apps and finally into a curation of activities that engage the wonderful new world of Swift Playground. We love the potentials of coding, particularly for our wonderful students who we can engage in such powerful educational dialogues regarding creativity, critical thinking, problem solving skills, executive functioning processing - all the most critical parts involved in becoming your very best self. 

You can subscribe to our iTunes U course here: 'Coding for Life' - Subscribe

 

Welcome to 'Coding for Life'. We are Craig and Heath from the Aspect Hunter School in Newcastle, Australia. For us, learning to code is all about learning how to think. Coding is the language that allows you to create programs on a computer, but it is also the language of logical thinking. When you think about the steps involved in brushing your teeth, or packing your bag for school, or building a bed in Minecraft, your braining is using the language of coding. 

A few months ago, Apple released an amazing new app for iPad called 'Swift Playgrounds'. Apple developed the Swift programming language to allow creators to make software for Apple hardware like iPhones, iPad, MacBook and Apple TV. It is an incredibly powerful programming language, and now with 'Swift Playgrounds' you can easily learn how to code with Swift by following the fun lessons found inside the app.

We want to show you how to start working with Swift Playgrounds, but we want to take you in a different direction, through learning how code relates to your life. We want to take you through a sequence of activities that let you realise how much of your life is already related to coding, and we want to give you activities to do at home and at school, on the playground and in the classroom, on and off your iPad, so you can work your way up to having a strong understanding of code before you have fun in Swift Playgrounds. We also have some very special and unique assignments for Swift Playgrounds here that you won't find anywhere else. 

Thank you for joining us on this 'Coding for Life' journey - if you have any questions or feedback along the way, you can reach out to us on our Twitter accounts: Craig Smith (@wrenasmir) and Heath Wild (@heathwild). 

Think about some of your daily routines, about what do you do when you get out of bed first thing in the morning, what do you do to get dressed. There are so many things that you learn to do by breaking a big task into several smaller tasks. You learn to get dressed by thinking of the right sequence to follow, it might go something like this:

  1. Put your underpants on, then
  2. Put your pants on, then
  3. Put your shirt on, then
  4. Put your socks on, then
  5. Put your shoes on. 

But then, think about how to learned to put your shoes on - that is a logical sequence you learned to follow as well! You learned to put your foot in the shoe, and then do your laces in a certain way, looping this one over that one. So, now we have a big sequence like 'Getting dressed of a morning', and also small sequences within this such as 'Putting your shoes on'. All of this is your brain learning to code.

Assignment - Sequenced Living

Write down a sequence of instructions for your following daily routines: Making a piece of toast; Packing your school bag; Setting the table for dinner; Getting ready for bed. Check out the 'Real Life Algorithms: Daily Activities' link below as well for additional resources that can help you with this assignment.

 

Assignment - Giving Instructions

Using the 'Choiceworks' app on your iPad, create a sequence of instructions for a friend of yours to follow at school. Choiceworks is used to create visual sequences that show people how to complete a task. Create Choiceworks visuals for a classmate to follow the following tasks: Washing hands before eating lunch; How to climb across the playground; Getting your desk ready for the school day.

Getting to know your school environment can take a while, schools are often big areas with long playgrounds and a lot of buildings placed close to each other with corridors and hallways running between. This can also be a terrific space for us to test out new coding skills. 

The first of our two assignments here is to write down a series of steps for how you would get from the front door of your classroom to the school library. Or, from the front school gate to the school office, or any other destinations you would like to choose. Think about different ways you could give directions - you could give directions such as 'Walk twenty steps in front of you when you leave our classroom, then turn to your right and walk ten steps', or you could increase your Creative Code skills and place Red Dots and Green Dots around the school and say, 'Walk until you see a Dot. If it is a Red Dot, turn Left. If it is a Red Dot, turn right. If there is no Dot, keep walking forward'. Think of different Coding strategies you could use here, and give you completed directions to a friend to see if they can get to the right destination using your instructions! You could create a map of your school in Shape Lab to help you get a better picture of the area. 

The second assignment is to guide a Sphero robotic ball around the school garden or agriculture area. Pick a point 'A' to start from, and a point 'B' to get to. Draw a map of the garden area in an app like Paper and work out the directions you need to provide to Sphero. Then, using the SPRK app, code directions for Sphero to drive from point 'A' to point 'B' in the garden area, as guided by your map.

At our school we love to take learning outside of the classroom. We can use the natural world and the games we play with other people as a way to learn more about the principles of coding. 

Your assignment here is to help you learn about the way that we transfer information to computers and other digital devices using a mathematical sequence known as Binary Code. We will learn about Binary by making our names using sticks and stones to represent the Binary system. 

Craig_Binary.jpg

Have you ever thought about how a computer stores all the information that it needs to function and do all the things that we want it to? Data is stored and communicated to computers as a combination of ones and zeros in a language known as binary. In this activity we are going to explore using just TWO different symbols to communicate information. The information we are going to communicate in this activity is YOUR NAME and the symbols we are going to use, instead of ZEROES and ONES, are STONES and STICKS. Zeroes will be Stones, and Ones will be Sticks. First: write your name in binary using STONES and STICKS and then we will test our friends ability to read binary by writing out our favourite food.  Who will be the first person to decode the binary symbols?

Coding and music are a fantastic mix. Music is the organisation of sound, and sound is mostly organised according to logical mathematical principles. Coding taps into this sequencing of logic in way that will help you understand coding in a more creative way. 

Your assignment for this section is to create a simple composition for an instrument using basic coding principles. You're going to be colour coding notes - you could get coloured sticky dots and put them on keys on a piano, or beneath strings on a guitar, or on drums. Then, you're going to draw patterns of coloured dots on paper, using a 'loop' command to show you when to repeat certain patterns. Look at the following example we've drawn in the app Paper:

For this example, if you had coloured sticky dots on piano keys, you would play 'Yellow, Blue, Orange, Green' three times over, as they are in a loop bracket. Then, you would play 'Blue, Orange' twice over, and then 'Yellow, Green, Orange, Yellow' four times. The lesson to be learned here is all about the value of looping commands, and writing music notation out in this way and playing it on an instrument gives you a new perspective on the creativity of looping code. 

There is an instrument, Skoog, that is a cube with coloured circles on each side that, when pressed, operate music commands on an iPad. Skoog connects via Bluetooth to an iPad and allows you to play music by hitting and squeezing the sides of the Skoog. The above activity works really well with Skoog if your school has one, and we have also used Lego Blocks to notate music for Skoog in a similar way to the drawing of coloured circles above:

Using coloured Lego blocks on a base plate achieves a similar notation effect to drawing coloured circles. How could you create loops on the Lego base plate? What sort of ways could you group coloured blocks and sequence them in ways that could lead to interesting musical performances? Think about what you've learned about coding and have fun experimenting. 

In this Minecraft PE Redstone coding assignment you will create a Redstone Circuit that password protects an Iron Door. When the correct sequence of commands (an algorothim) is entered, the door opens. 

We enter the passcode by turning Levers either ON or OFF. This is very similar to the way we communicate digital information with the Binary Code system like we did earlier creating our names with sticks and stones. In the build outlined in this activity the passcode for the door is to turn the Levers 134 & 6 on. If we say that Levers are a 0 when they are off and 1 when they are on, then we can write our passcode as: 101101.

Once you have done this build, see if you can change the Redstone Circuit so that a different passcode is needed. 

You could also think about how you could communicate the passcode in a secret way to your friends - maybe you use two different types of block, or animals in pens, or tree types, near the Levers, so that your friend will be able to read the passcode in Binary. Experiment and be creative. 

Scissor Paper Rock Lizard Spock

We have a challenge for you. Can you design and code your own version of 'Scissor Paper Rock' using Swift Playground? Those of you who are fans of The Big Bang Theory will be aware of the version of the game developed by Sam Kass called 'Scissor Paper Rock Lizard Spock'. We want to see if you can write the code for this version of the game. Best of luck! 

Know if we want to edit this code so that we can play Scissor Paper Rock Lizard Spock then we need to do two things: 1) We need to add two new Actions, and 2) we need to add more Rules for the Actions. The picture below shows you what those new Actions and Rules need to be and how they need to be written.

Happy coding! :)