Oct 23, 2016 - Writing for our blog or sharing resources! You could .... where we share all our best bits, but leave out
in partnership with
!
Code%Week%UK% Guide%for% Event%Organisers% 15th – 23rd October 2016 #codeweekUK
%
Codeweek.UK in partnership with
http://www.discoveryeducation.co.uk Discovery Education empowers teachers and captivates pupils by providing high-quality, dynamic, digital content to primary and secondary schools across the United Kingdom. We are passionate about and committed to enhancing the way teachers teach and students learn; adding meaning and relevance to the school curriculum, and helping teachers and students to reach their potential. Discovery Education offers a range of services and opportunities for schools to meet the needs of students in the digital age. With award-winning digital content, interactive lessons, virtual experiences with some of Discovery's most talented presenters and contributors, classroom contests and challenges, professional development and more — Discovery Education is leading the way in bringing learning to life. What our partners say: "Discovery Education Coding simplifies the relevant coding requirements of the new Computing Curriculum. It is child centred and engaging with a logical progression which empowers teachers to deliver the skills and knowledge with confidence." Helen Wiles, ICT Leader St. Peter's Catholic Primary School, Lytham "I would just like to say that I am delighted with the resources available on Discovery Education Espresso. The children I work with find the videos far more engaging than myself droning on at the front of the class and then to be able to consolidate by "playing games" - what more could they ask for. Long may you continue to provide such inspirational, time-saving resources." Frances Southwell, HLTA Giles Junior School, Hertfordshire !
!!!
!
Invitation!to!Primary!&!Secondary!Schools! Pupils!and!Teachers!are!invited!to!attend!the!Code!Week!UK!Launch!Event!;!up!to!10! children!and!!2!teachers!from!each!school!are!invited!to:!
Explore,!Make,!Learn,!Meet!and!Share!! Virtual!Reality!K!Coding!–!Robotics!–!Kits!–!Networks!–!3D!Printing!–!and!More!! Simultaneous!Learning!Computing!Activities!! for!children!&!Computing!CPD!sessions!for!teachers!
!
Code%Week%UK% Kick%Off%Event% Friday%14th%October%% 12%–%3:20pm%lunch%provided%
!
With a Technology Fair - open to all from 3:45 to 5pm e-mail:
[email protected] Twitter: @codeweekUK
Eventbrite: http://bit.ly/codeweekUK % In partnership with
% %
Dragon%Hall% 17%Stukeley%Street%% London% WC2B%5LT%
%
CONTENTS Page What is Code Week UK?
2
How can you get involved?
3
Activities for Code Week UK Free sample Lessons by Discovery Learning
7
Literacy: Look Up by Jane Waite
8-12
Scratch Jr: Underwater Fun by Su Adams
13-17
Make a game: Hoping frog by Yasemin Allsop
18-21
HTML: Tag Tag Revolution by Mozilla & MOUSE
22-24
Networks: Ping Kong by MOUSE & Mozilla
25-30
HTML: Hack the News by Hive NYC & Mozilla
31-34
Slug Trail by Phil Bagge
35-46
Counting Machine by Phil Bagge
47-53
Unplugged: Maze by Nic Hughes
54-55
Creating Kodu by 3BM
56-58
Scratch: Starting with Scratch by 3BM
59-61
Kodable lesson plan by iTeach
62
Jigsaw by Neil Smith
63-69
Beginner Javascript by CoderDojo
71-88
My First Website by CoderDojo
89-108
!
1 2
What is Code Week? Codeweek UK aim to raise and celebrate
that will help us to adapt to living in this
the importance of coding activities by
new era.
connecting the communities around the UK.
of how things work, explore ideas and
Today we live in a world that has been
make things, for both work and play.
affected by rapid advances in technology.
What’s more it helps us to unleash our
The way we work, communicate, shop
creativity and work collaboratively with
and think has changed dramatically. In
wonderful people both near us and all
order to cope with these rapid changes
over the world.
and to make sense of the world around us, we need to not only develop our understanding of how technology works, but also develop skills and capabilities,
2
Learning to code helps us to make sense
Let’s work together to provide opportunities for everyone to have a chance to try out coding!
+ How can you get involved? There are many ways you could get involved in Codeweek.uk
Organising and/or attending to an event You can organize an event to teach coding to children or adults. If you are a teacher this could be an activity as part of your lessons. You can then add your event to our website to share with everyone. Your event doesn’t have to take place during Code Week, it could be at any time during the year!
Writing for our blog or sharing resources! You could share your ideas, experiences or news from your events on our blog! The more we share, the more we learn! We are interested in anything you do in the name of coding!
Sponsoring Codeweek.uk Code Week UK is organized by volunteers and receives no financial aid. If you would like to be a partner with us and support our activities please contact us:
[email protected]
Spreading the Word! • You can follow us on Twitter @codeweekUK and like our Facebook page: https://www.facebook.com/Codeweekuk475492319315384/ • Tell us what you’re doing for Code Week UK using #codeweekUK 3
+ Activities for Codeweek Codeweek.uk UK
–
There are many online resources available for you to useonline when There are many
resources available for running codeweek.uk activities. youcan tofind use when You links to some of the running codeweek.uk
resources on our website. activities. You can find
links to some of the resources on our We know it is very difficult to website. find interesting tasks and
projects to use when teaching
We know that it can be very difficult to find we decided sharetasks with you some interesting and projects to use when examples. teaching coding to children and adults. We Indecided the following section some we to share examples with you. shared some interesting activities coding to children and adults. So
that you can use for your Code Week UK event. If you have a great idea why not share with us?
[email protected]
4
Free sample Lessons by http://www.discoveryeducation.co.uk/what-weoffer/discovery-education-coding/try-it-now
Digital Literacy: Look Up by Jane Waite Overview Time: 1hr + Age Group: UKS2/KS3 In this lesson pupils use a poem about the impact of mobile phone use on peoples’ lives to prompt discussion on this topic. In small groups, pupils analyse parts of the poem and create dance moves to express the ideas raised. As an alternative, pupils could create an animation, a piece of art or use drama. This activity links to the national curriculum for computing’s objective ‘use technology safely, respectfully and responsibly’. It also provides pupils with the opportunity to practise a range of computational thinking concepts and approaches, such as abstraction (working out what is important), decomposition (breaking something down into its parts), algorithmic thinking (making steps or rules), debugging, creativity and collaboration. (These concepts and approaches are based on the Barefoot resources.) This activity was inspired by the A2Arts’ dance production of ‘Look up’, choreographed by Amanda Schofield. The dance has qualified for the All England Finals Dance Competition in 2017.
Activity: Look up Creating choreography on the impact of mobile phone use.
Resources Choose one of the following versions of the poem ‘Look Up’ by Gary Turk • adapted version of the poem in Appendix A (with no swear word and shortened) • original version of the poem http://garyturk.com/portfolio-item/lookup/ • video https://www.youtube.com/watch?v=Z7dLU6fk9QY Print out copies of the poem for your pupils. Before the activity please watch the video, read the original and the adapted version of the poem to decide which version is most suitable for your class. There is one use of a swear word at 45 seconds on the video this is verse 5 line 2 in the original poem. This word has been replaced in the adapted version of the poem in Appendix A with the word ‘people’. (For younger pupils, the book ‘Dot’ by Randi Zuckerberg explores similar ideas and could be used in a similar way to the poem ‘Look Up’).
Objectives • • • •
I am starting to understand the consequences of spending significant amounts of time online I can come up with creative ideas to express ideas I can create an algorithm I can work in a group
Success Criteria • •
Pupils identify parts of the poem which relate to the impact of using mobile phones for significant amounts of time. Pupils create an algorithm of moves that express ideas within the poem.
Teacher Input Based on the version you have chosen, share this with pupils.
6
Digital Literacy: Look Up by Jane Waite Discuss the poem with pupils, asking them to think about the impact mobile phones have on their lives and the lives of their families. (There may be some sensitive issues raised.) You could link this to maths, creating a table of estimated use of mobile phones and then gather real mobile phone use of family members to compare. Using ideas from the class model how to take one part of the poem and create a set of simple dance moves that express the poems ideas. Show pupils how to write out the selected lines and for each line adding small images and notes to show the dance moves. This set of informal images and notes is an algorithm as it shows the ordered set of steps that need to be followed. An example is shown in Appendix 2. Demonstrate how to test (debug) the algorithm, by asking a group of pupils to follow the algorithm, show how to improve your notes to make them more precise.
Activity In groups, children select one or two lines, a verse from the poem and think of dance moves to express the ideas raised. You could break the poem down into parts (decompose) and assign the groups different parts of the poem to create a whole performance. However, pupils may find it more interesting to choose parts themselves, in this way they are decomposing the poem themselves. Use mini plenaries to share ideas, algorithms and developing performances, both to the whole class and to other groups. Encourage pupils to test their algorithm as they develop it, not just once at the end.
Plenary Ask groups to share their routines with the whole class. Options for discussion include: • •
•
Discuss how easy it was to come up with ideas, to create the algorithms and implement these as dance moves and to work as a group. Discuss how professional choreographers create their routines, and why precision is needed. You could discuss whether computers can generate dance routines, this can lead to a talk on machine learning and AI. (See CS4FN Magazine Issue 22 Creative Computing) Discuss what impact the poem and performance has had on pupils and how it might impact other people they know, or other age groups.
Assessment Suggestions Observe pupils as they work, are they considerate of, and develop, others ideas. Ask questions about what is most important and why in the poem. Review pupils’ algorithms are they are complete and easy to follow. You could challenge groups to follow other teams’ algorithms. Ask pupil questions related to their understanding and appreciation of the impact of use of mobile phones. For self and peer assessment, perhaps start to create criteria of what makes a good algorithm for dance choreography e.g. small simple icons, facing direction shown, number of repeats included, imaginative moves, facial expression notes added, starting position shown.
7
Appendix 1
Look Up. I have 422 friends, yet I am lonely. I speak to all of them everyday, yet none of them really know me. The problem I have sits in the spaces between, looking into their eyes, or at a name on a screen. I took a step back, and opened my eyes, I looked around, and then realised that this media we call social, is anything but when we open our computers, and it’s our doors we shut. All this technology we have, it’s just an illusion, of community, companionship, a sense of inclusion yet when you step away from this device of delusion, you awaken to see, a world of confusion. A world where we’re slaves to the technology we mastered, where our information gets sold by some rich greedy people. A world of self-interest, self-image, self-promotion, where we share all our best bits, but leave out the emotion. We are at our most happy with an experience we share, but is it the same if no one is there. Be there for you friends, and they’ll be there too, but no one will be, if a group message will do. We edit and exaggerate, we crave adulation, we pretend we don’t notice the social isolation. We put our words into order, until our lives are glistening, we don’t even know if anyone is listening. Being alone isn’t the problem, let me just emphasize, that if you read a book, paint a picture, or do some exercise, you are being productive, and present, not reserved or recluse, you’re being awake and attentive, and putting your time to good use. So when you’re in public, and you start to feel alone, put your hands behind your head, and step away from the phone. You don’t need to stare at your menu, or at your contact list, just talk to one another, and learn to co-exist. I can’t stand to hear the silence, of a busy commuter train, when no one wants to talk through the fear of looking insane. We’re becoming unsocial, it no longer satisfies to engage with one another, and look into someone’s eyes. We’re surrounded by children, who since they were born, watch us living like robots, and think it’s the norm. It’s not very likely you will make world’s greatest dad, if you can’t entertain a child without a using an iPad.
8
When I was a child, I would never be home, I’d be out with my friends, on our bikes we would roam. We’d ware holes in our trainers, and graze up our knees; we’d build our own clubhouse, high up in the trees. Now the parks are so quiet, it gives me a chill to see no children outside and the swings hanging still. There’s no skipping or hopscotch, no church and no steeple, we’re a generation of idiots, smart phones and dumb people. So look up from your phone, shut down that display, take in your surroundings, and make the most of today. Just one real connection is all it can take, to show you the difference that being there can make. So look up from your phone, shut down those displays, we have a finite existence, a set number of days. Why waste all our time getting caught in the net, as when the end comes, nothing’s worse than regret. I am guilty too, of being part of this machine, this digital world, where we are heard but not seen. Where we type and don’t talk, where we read as we chat, where we spend hours together, without making eye contact. Don’t give in to a life where you follow the hype, give people your love, don’t give them your like. Disconnect from the need to be heard and defined Go out into the world, leave distractions behind. Look up from your phone, shut down that display, stop watching this video, live life the real way. By Gary Turk (Shortened and one word changed by Jane Waite – permission requested from author.)
9
Appendix 2
This lesson plan is licensed under a Creative Commons Attribution-NonCommercialShareAlike 4.0 International License. The Look Up video and poem is © Copyright 2016 · Gary Turk http://garyturk.com/portfolioitem/lookup/. 10
Scratch Jr: Underwater Fun by Su Adams Overview Time: 1hr Age Group: KS1/LKS2 In this activity children will use Scratch Jr on iPads to create an underwater animation. They will select an appropriate background, then add in underwater sprites (characters and objects), including a diver, which they can animate by touching the sprites, making them move using various motion blocks. Children will use the camera to put an image of their face in place of divers blank face. Children can then go on to use grow and shrink, and layering to make a crab appear to scuttle away and hide.
Activity: Underwater Scene New Project
Choose a background: o
o o Delete the cat: o Tap and hold the cat
o
11
Scratch Jr: Underwater Fun by Su Adams Add Characters Add a fish that swims when you touch it:
o o o o Add in a diver that swims when you touch it and looks like you:
o o o o o o o
Tap the divers face so that you can take your photo Add in your face
12
Scratch Jr: Underwater Fun by Su Adams Add a wiggly fish Add in another different fish that moves when you touch it Make your new fish look like it’s swimming with a wiggle: o o o
o o o
I Can Do More! Make a rock o o o Make your rock shape !
Extra: Choose another colour to add texture
13
Scratch Jr: Underwater Fun by Su Adams Add a crab, make it hide behind the rock when touched: o Move the rock to the bottom o Move the crab to be beside the rock o Shrink the crab, it looks like it’s moving backwards o Make it move towards the rock o Make the crab move the opposite direction o Make it grow again, to make it look like it is moving forward o Drag the wait block to your script, just before repeat forever block
Add instructions • We need to tell players how to make the characters move. • Click on
at the top of the screen
• Add your instructions • Test your game.
Challenges Challenge 1: Make the wiggly fish swim smoothly. Challenge 2: Make the diver say something. Challenge 3: Make a character move when you tap the green flag. Challenge 4: Make a change so that the crab only hides once when you touch it and doesn’t keep hiding. Challenge 5: Add in the starfish and the seahorse. What will you make them do?
14
Scratch Jr: Underwater Fun by Su Adams Teacher Tips: To bring the rock in front of the crab, drag and drop the rock. Whichever is the last object touched, will be the object at the front. When adding in the diver’s speech bubble it will appear after every 1 right move. To adjust this increase the number beneath the right move block. Children should explore what happens when different numbers are entered and make an decision about what would work well. To make an object only complete a line of the code once and not repeat forever, change the end block to the blank End block.
Reviewing Creations o
o o
What problems did we have and how did we fix them? • Who found that the crab not behind the rock? • How did you fix this? How can we make the crab hide for longer behind the rock? Can you make the diver say something? • What happens when we tap the diver? • How can we correct this without using more blocks?
15
3.4
Make a Game: Hopping frog!
by Yasemin Allsop
!
!
INTRODUCTION In this activity the students will make their first computer game called ‘Hopping frog’ using Scratch. They will learn to use sequence, selection, loop and variables in the Scratch programming environment. As an extension the students will be challenged to create and use ‘score’ variable. If any children are not familiar with Scratch they must complete Activity 3 before starting this task. Tell children that when they complete making their game they will receive ‘Computer master 1’ badge for their assessment log. Those complete the challenge task and create a score variable will also receive ‘Super Computer’ badge.
Learning Objectives • Use sequence, selection and repeat in programs • Design and write programs that accomplish specific goals • Work with variables
!
TEACHING SEQUENCE
⇒
Create a maze on the floor using tissue paper in a large
indoor or outside space. Blindfold a child and move them to the starting point of the maze. Ask the other children to stand at the side of the maze and give precise instructions
• • • • •
Key Vocabulary Sequence Selection Loop Variable Debug
• • • • •
Resources Tissue paper Blind-fold Wipe off boards & pens Scratch Program Task sheets
to help the blindfolded student to complete the maze. Encourage them to use positional language and mathematical vocabulary when giving instructions. Discuss how the repeat and sequence functions can be used to design an efficient solution. Repeat the activity a few times by changing the maze design. If needed let the children use a white-board to write down their instructions.
⇒
Tell the students that they will be creating a game
called ‘Hopping frog’ using the Scratch program. Show them the Figure 3.4.1 Hopping Frog game and discuss what script is needed to create each action.
⇒
Provide the students with the ‘Hopping Frog instruction sheet. Let them
complete the game either in pairs or independently. Remind the students to take either a screenshot or photo of the problems they may meet and keep a record of the strategies they used to solve them.
This activity is taken from ‘Primary Computing in Action’ book by Yasemin Allsop and Ben Sedman
⇒
Those who are ready to move on can work on the challenge task which
requires children to create a ‘score’ variable.
Figure'3.4.1:'Hopping'Frog'game
ROUND UP! !
Ask the class to share any problems they had when writing their scripts and the strategies that they used to debug them. Discuss what else can be done to make this game more interesting and challenging. Select a student who created a score variable as a challenge and ask them to explain their thinking.
ASSESSMENT OPPORTUNITIES
⇒ Ask the children to take either a screenshot or a photo of their problems and then later on to explain the steps they went through to solve them.
⇒ Look at the children’s completed game designs and task sheets to see if they used repeat, loops and variables correctly to complete the task. This can be either a peer or a self- activity and the criteria can be set at the beginning of the session using our ‘My Computing Progress Log’ found in Chapter 12.
⇒ Keep records of their interactions during whole class discussions. !
This activity is taken from ‘Primary Computing in Action’ book by Yasemin Allsop and Ben Sedman
3.4'
HOPPING FROG !
STEP 1: Let’s'create'the'backgrounds ! ! • Open!Scratch:!www.scratch.mit.edu' • Click!Create!tab!to!start.!Right!click!on!the!cat! sprite!and!click!delete.' • Select!the!stage,!and!then!select!the! backdrops!tab.!Click!on!the!paintbrush!to! draw!a!pond!as!below.!This!is!background!1.' • Duplicate!the!background!1!and!add!‘Game! Over’!text!at!the!top.' ! ! ! ! ! ! STEP 2: Draw'a'lily'pad'sprite' • Click!on!the!paintbrush!in!new!sprite!section! to!paint!a!new!sprite.! • Draw!a!lily!pad!using!circle!and!line!tool.! Change!the!name!to!‘lily!pad’.! • Use!the!centre!tool!to!set!the!centre!as!the! middle!of!the!circle!as!shown!in!this!picture.! ! !
! ! ! !
STEP 3: Add'the'frog'sprite' • Click!on!the!choose!sprite!from!library!tab!in! the!new!sprite!section.! • Select!frog!sprite!from!animals!file.!! • Your!screen!should!look!like!this!image.! • Please'save'your'game.' ! ! !
! ! ! !
STEP 4:'Add'script'to'lily'pad'sprite'
We!want!to!move!the!lily!pad!horizontally!using! the!mouse.! • Set!the!lily!pads!coordinates!to!(x=0,!y=–70)! • Add!this!script!to!lily!pad.!! • Test!your!script.!What!happens?! ! ! !
This activity has been taken from ‘Primary Computing in Action’ by Yasemin Allsop and Ben Sedman
STEP 5: Add'script'to'Frog'
!
• We!first!want!or!frog!sprite!to!start!at!(x:0,!y:! 100)!coordinates!and!then!move!at!a!random! angle!between!100!and!220.' ' • Then!we!create!a!forever!loop!and!place!two! if!conditionals!in!the!loop.' ' • If!the!frog!touches!the!lily!pad,!it!bounces! back!at!a!random!angle!between!!T40!and!40! and!play!sound!‘pop’.' ' • If!the!frog!touches!the!any!part!of!the!pond! (Blue!colour),!it!broadcasts!game!over,!waits! for!1!second!and!then!stops!the!game.!'
! STEP 6:'Add'a'script'to'Stage' • We!need!to!write!a!script!to!start!the!game! with!background!1.! • When!we!receive!game!over!broadcast!we! need!to!switch!to!background!2.! • Save'and'test'your'game.' !
! !
! !
CHALLENGE!
!
At!the!moment!there!is!no!score!received!for! successfully!controlling!the!lily!pad!to!stop!the! frog!from!touching!the!pond.!Can!you!create!a! score!variable!so!that!every!time!frog!sprite! touches!the!lily!pad!score!increases!by!1.! Explain!your!solution!below.! ! !
Time to check and discuss o Can you move the lily pad horizontally using the mouse? What would happen if we use mouse y instead of mouse x? o When you click on the green flag do frog sprite moves randomly? What happens if you change the value of angles? o Do frog sprite bounces back at a random angle when it touches to lily pad? Why did we use angle with negative value?
HTML: Tag Tag Revolution by Mozilla & MOUSE Overview Time: 20mins Age Group: KS2/KS3 Learners will choreograph a dance party with tag cards, learning code and participation. Link to activity and online resources: https://thimbleprojects.org/juliavallera/101782/04-tag-tag-revolution.html#overview
Read, Write, and Participate the Web 21st Century Skills • Collaboration • Communication • Creativity • Problem-solving
Learning Objectives • • •
Describe the purpose of HTML tags within source code. Describe the function of both open tags and closed tags. Demonstrate how HTML tags affect elements on a webpage.
Materials • •
•
Tag cards: draw your own with paper/marker Tape, string, or paper clips to make it possible for participants to wear the tags, hands-free Upbeat music
Preparation TIP: This game is best played with groups over 10. If you have a larger group, you may want to add some extra silly tags or if you have a small group you may want to use fewer. Feel free to make up your own. Be creative. Make Tag Cards: Make your own on separate pieces of paper, write the following “tags” (be sure to include the arrow!): Open tags: " →" (also sing, stomp, spin, shake). Close tags: " ←" (also sing, stomp, spin, shake). Clear enough space in the room for players to stand in a circle.
16
HTML: Tag Tag Revolution by Mozilla & MOUSE Introduction 5 minutes Ask participants to raise their hands if they know some HTML already. On a projector, go to any website and click “View Source” to show the HTML code for that page. "View Source" is usually under the "View" or "Tools" tab of a browser's menu. If you have a participant with HTML experience, ask them to see if they can point out a tag in the code. Make sure to introduce these concepts before starting the game: • HTML stands for Hypertext Markup Language and is the standard “markup” for contributing pages to the web. • HTML Tags tell your web browser how translate the code into the website that most Internet users will see. For instance, HTML tags can tell your browser when to turn text into a link, or how big to make the words on the page. • An Open Tag, , tells the webpage when to start doing something, while a Closed Tag, , tells the webpage when to stop. Image created by MOUSE
Getting Started 10 minutes Explain to participants that they are about to have a fun dance competition to show them how HTML tags work. To get things started, 1. Arrange the players into a circle, making sure there is enough room to walk around the outside of the circle. 2. Select 2 players from the group to be the “Coders”. Hand one of them the first open tag and the other one the corresponding closed tag. Start with an easy one like and . 3. Start the music and have the 2 Coders walk around the outside of the circle while the other players stand still. Make sure the Coders keep a little distance between them. You could have them start walking 5 paces back from each other.
17
HTML: Tag Tag Revolution by Mozilla & MOUSE
4. When you stop the music, the Coders attach the tags to the members of the circle they are standing closest to. 5. Everyone who is standing in between the arrows of the open tag and closed tag ; will now have to start clapping (the people wearing the tags, don’t have to). The clapping players should continue to clap for the rest of the game. 6. Now select 2 new tags and hand them to the Coders (for instance and ). 7. Repeat steps 3 & 4. This time, when the Coders hand over the tags, anyone who is between the tags will have to sing. If any players are between both the tags AND the tags, then they will have to clap AND sing. 8. Continue these steps again with the rest of the tags (and any other tags you want to add the game) to make a fun, complicated tag dance party! When the Coders have the final tags, ask them to join the circle wherever they are once the music stops (instead of handing the tags to people in the circle). Everyone standing between the tags the Coders are holding performs the actions on their tags.
9. After all the tags have been used, you could have the players with tags move around one at a time to change up who is doing what. This will help communicate how tags work in HTML code.
Reflection 5 minutes Ask learners to choose any website and “view source” to look for tags and guess what each tag does. NOTE: some websites, like Google or Facebook have more complicated code and not enough simple HTML to explore. News sites, wikipedia, blogs, YouTube, and company or organization websites are better choices for beginners. Reflect on the activity with participants in a short discussion using guiding questions like these:
18
•
What was it like to play this game?
•
What did you do when you were not between the open and closed tags?
•
What happened when you were between 2 different tags?
Networks: Ping Kong by MOUSE & Mozilla Overview Time: 1-2hrs Age Group: KS2/KS3 For many, "the Internet" is an abstract and overwhelming concept. This activity challenges learners to think concretely about how the internet communicates with a computer. Link to activity and online resources: https://mozilla.github.io/mozilla-club-activity-ping-kong/#en
Preparation Next do the activity on your own to become familiar with it. Familiarize yourself with the following terms: 1. Command line/Command Prompt 2. Hop 3. Internet Protocol (IP) Address 4. Internet Service Provider (ISP) 5. Web Server 6. Local Area Network (LAN) 7. Packet 8. Ping 9. Router 10. Traceroute Print and cut out the Ping Kong obstacle course signs. Clear enough space in your room for an "obstacle course." Hang up the cards labelled "My computer" and "The Website" on opposite sides of the room.
Introduction Ask learners, "How do you get to the Internet?" Take a few ideas from the group, then explain the following: The "Internet" is a system of networks and the "Web" sits on top of the Internet and provides an interface for viewing and interacting with the information stored in various computers around the world. This short article from Skillcrush further explains the difference between the Internet and the Web. Further explain that: Anytime you ask the Internet to do something, whether by entering a URL into a browser or watching a video on YouTube, your internet request "hops" through several network devices, like routers and switches and servers, on its way from your computer to the website’s server. Watch the introductory video to give learners a little more context before starting the obstacle course:
19
Networks: Ping Kong by MOUSE & Mozilla
20
Networks: Ping Kong by MOUSE & Mozilla There and Back Again: A Packet's Tale
Perform the Net Form small improv groups of 4-5 actors. Get together and brainstorm a way to perform how the Internet works. Think about how to use your space - you can perform anywhere there's room in the space around you and spread out and move around as much as you'd like. Think about the materials around you and grab any props that might help you show the Net at work. Perform your skits for one another. Applaud your heart out for the other groups. Laugh and cheer at especially great moments of Performing the Net history!
Set up the Obstacle Course Say that to help understand this path, we're going to act out a human ping/traceroute in an obstacle course. We'll travel from a i) local computer through ii) a LAN to the iii) Internet to get to iv) Google.com or the website of your choice.
21
Networks: Ping Kong by MOUSE & Mozilla
Ask the group to gather underneath the "My computer" sign and ask for three volunteers. Hand three of the volunteers the signs labelled "Hop 1: Local Router," "Hop 2: Internet Service Provider and "Hop 3: The Website Company's Router" and ask them to spread out throughout the room. Explain that the signs represent different "hops" that an Internet request must go through before it gets to the website a user is looking for. The rest of the students are packets of computer code trying to get to the website at the other end of the room.
Model the Obstacle Course Choose one of these "packet" students to act as a model for the rest of the group before they all start the activity. Give the learners the following scenario I’m at my computer and I decide to watch a video on YouTube. After I type in the web address, my computer converts ‘youtube.com’ into a code that all computers can read and then divides that code into several internet "packets". This volunteer student represents one of those packets.
Hop 1: Local Router Ask the example student to walk to the "Hop 1: Local Router" and explain: First the packet will hop through local network devices like routers, switches or modems in your building. The local network devices then send the packet to the Internet.
Hop 2: Internet Service Provider Have the student walk to and explain the next hop: After a packet gets here, to the Internet service provider, it is sent all the way to one of YouTube’s routers.
22
Networks: Ping Kong by MOUSE & Mozilla Hop 3: Company Router Once the packet gets through YouTube's router, it is sent to a computer in the company's headquarters that will stream my video.
Website In order to get the video to stream on my computer, YouTube’s computer converts my video into packets too, which travel all the way back to my computer on the same path of network devices it took to get to YouTube. Ask the example student to walk back to you, making sure to pause at each hop on the way back.
IP Addresses When the student returns, ask if anyone knows how the devices at each hop know exactly where to send a packet. If no one knows, explain: They use IP addresses! Every device or computer in a network or online has an IP (or "Internet Protocol") address. It’s like a home address - and it helps devices find each other and communicate. IP addresses have 4 sets of numbers in a string like this: 172.168.3.12
In Between Hops To make the obstacle course more interesting, you might place "government spies" between hops. This resource from the EFF explains how third parties might intercept data between hops. Talk with your learners about what data is protected, what's vulnerable, and to whom.
Off to the Races! Now it's time for everyone to try the obstacle course! Explain to the students that they are all "packets" trying to make their way to Google.com (or the website you chose) to complete someone’s Internet request. They must stop at each "hop" before moving on to the next one. But wait, there's a twist! Before the packets can get from one hop to the next, they must complete a quick challenge posed by the student acting as the Hop. Examples: Do 5 jumping jacks! Sing "Happy Birthday" etc. When the packet completes the Hop's challenge, the Hop will allow the packet to move the next location until the packets reach "The Website". Ask the packets to form a single-file line and move through the obstacle course as quick as they can! You can have someone time how long it takes everyone to get through the course to see who makes it the fastest.
23
Networks: Ping Kong by MOUSE & Mozilla Reflection After all learners have completed the obstacle course, show them just how quickly packets are able to move through the the Internet in real life. If you don't have internet connectivity or are short on time, skip the Ping Utility exercise. Ask the group some reflective questions like: •
How long did it take you to get all the way from the computer through the Internet to the website?
•
Do you think a computer moves faster through the Internet than you did?
•
What happens on the Internet when you type a Web address and hit enter?
•
What are the "parts" of the Internet?
•
How do large amounts of information ever make it through low-bandwidth parts of the Net?
•
What's the difference between the Internet and the World Wide Web?
Take a few guesses and then explain that we can actually tell exactly how long a real request takes by using the Ping utility in the Command Prompt (PC) or Terminal (Mac). Or if you are offline, just explain what would happen. Ping is a function on computers that lets you check to see if your computer can connect to another computer over the network or online by sending a ‘packet’ of data to it and seeing how long it takes for the packet to come back. Ask students to make specific guesses/bets for how long it will take for 5 packets to ping Google and come back. Write down their guesses on the wall. Either in groups (if equipment is available) or as one group looking at the projector, run the ping utility on google.com (use the tip sheet for instructions!). Discuss the results.
24
HTML: Hack the News by Hive NYC & Mozilla Overview Time: 45mins to 1hr Age Group: KS2/KS3 Learners will use X-Ray Goggles to remix a news website, learning about openly-licensed resources, different forms of media, and how to create something new on the Web through remix.Learners will choreograph a dance party with tag cards, learning code and participation. Link to activity and online resources: https://mozilla.github.io/mozilla-club-activity-hack-the-news/#en
Preparation Next do the activity on your own to become familiar with it. You may wish to set up a Webmaker account that you can share with your learners. This will save time later when they are ready to publish their remixes. Review this definition of the word "Hack", so that you can help your learners (and colleagues!) understand a positive context for the word. Optional: Print the HTML cheatsheet and X-Ray Goggles reference guide.
Introduction Welcome your students and explain that in this activity we're going to explore "remix." Give each student a piece of paper and a pencil. In pairs, ask the students to sketch their favorite fictional character. No need for accuracy or too much detail — just draw it quickly. After a few minutes, have the pairs swap their drawings. Prompt the students to add something to their partner's drawing. Explain that this is remix in action!
Hack the News using X-Ray Goggles In the same pairs, if enough equipment is available, have the students open a modern web browser. Else, demonstrate on one computer and form small groups afterward so the students can try it on their own.
Install the X-Ray Goggles Go to goggles.webmaker.org. Demonstrate how to drag the big yellow “Activate X-Ray Goggles” button to your browser’s bookmarks toolbar.
Navigate to a news web site Ask for suggestions for news site. Think about local newspapers, your school paper, or a national news site like The New York Times or The Guardian. Try to find websites that use a good amount of HTML, and not a lot of Javascript as it will be easier for your learners to remix. Don’t worry — you’re not actually hacking the site for others. You’re changing a local version of the site that only you can see.
25
HTML: Hack the News by Hive NYC & Mozilla Decide on a remix theme Inspired by the characters from the introduction, decide on a remix theme. Ideas include Nyan Cat, the Kraken, King Kong, or similar locally relevant characters.
26
HTML: Hack the News by Hive NYC & Mozilla
Activate the Goggles Click the Goggles in your bookmark toolbar to turn them on. Now when you mouse over elements of the news page, you’ll see the code underneath. Hit the “remix” button Hit “R” on the keyboard to remix any element. Change the text and swap in new images Try changing the headlines or rewriting some of the stories based on your fictional character. Edit some of the links and play with font size and color. Mouse over an image on the page and hit “R” / “Remix.” Then paste in the address/URL for your new image. To grab an image from Facebook or Instagram, you'll need to click into the post, then right-click and "Copy the Image Location". TIP: How to find and swap in openly licensed image. The Creative Commons search page or the advanced settings in Google help you easily find an image you like with permission to use it. Rightclick or control-click on the image you want and select: “Copy image location.” (Or “Copy image URL” or “Copy image address”, depending on your web browser.) Then paste your new image URL over top of the old one. Be careful not to lose the quotation marks!
27
HTML: Hack the News by Hive NYC & Mozilla
Share Publish your remix. Once you’re done, click the Publish button, or press P on your keyboard. This makes your changes visible on the web for others to see. Take it a step further. Have learners share their hacks with the news station their remixes used. Most news stations are on twitter, so try tweeting a link to them and think about their reactions.
Reflect and review Demo a few of the remixed pages and ask students to share what they changed. Consider prompts such as: What version of the website do you like more? What else would you remix? What do you wish you could remix but couldn’t? Why not? How else can you find media that you can remix? If time permits, invite students to continue by remixing their partner's new page. You can discuss how the web makes it easy to modify content in this way and that we're always remixing and building on what others have made. You can also discuss credibility and how understanding remix changes how you read or interpret information, as well as think about who authored it.
28
Slug 2 Trail by Phil Bagge
Chapter
A Code Week Special Using Scratch 1.4 Designed for Year 4+ Taken from How to Teach Primary Programming Using Scratch By Phil Bagge A code-it.co.uk resource
2C. Slug Trail Module Aim: Pupils create a slug that travels round a roadway leaving a trail behind. Can the user keep the slug on the road or suffer its hideous shrieks?
Module Learning Focus By the end of the module children will be able to: -
Decompose the program as a class
-
Build a game that uses continuous loops
- Investigate pen blocks within continuous loops - Generalise selection within a loop to reuse a concept for a similar function
Computer Science Concepts - Introducing the power of a continuous repeat loop - If else selection within a loop
Assessment for Learning At the end of each session direct pupils to page 11 of pupil workbook 2 to help them reflect on what they have learnt. It is often worth working through this line by line to avoid pupils filling in everything with a smiley face. You can also annotate this to record pupils who have needed much more support or have demonstrated greater understanding.
Time to complete module 3 hours
National Curriculum Programs of Study Pupils should be taught to: s DESIGN WRITEANDDEBUG PROGRAMSTHATACCOMPLISH SPECIlCGOALS including controlling or simulating physical systems;SOLVE PROBLEMSBYDECOMPOSING THEMINTOSMALLERPARTS s USESEQUENCE SELECTION ANDREPETITIONINPROGRAMS WORKWITH variables and VARIOUSFORMSOFINPUTAND OUTPUT s USELOGICALREASONINGto explain how some simple algorithms work andTO DETECTANDCORRECTERRORSIN
Adult Focus All adults need to be clear that they are to support using hints only and not solve things for pupils.
ALGORITHMSANDPROGRAMS
Debugging Hints s Compare teacher code with pupil's code s Read code aloud
Computational Thinking- Decomposition: breaking up a complex challenge into smaller parts and solving them separately before recomposing to solve the whole challenge
s What code works? Click/ run scratch blocks of code one by one s Read your code now read teacher's or peers' s Hand out hint cards
75
Chapter
Extension
2
8. Extension & Instructions 3a. Move Backwards (-1)
5. Pen blocks Experimentation
7. off road = sound 6. Create roads
4. Slug Trail 1. Decomposing
3. Moving Block
2. Drawing Slug Learning Path
Support Hint Cards
1. Decomposing the key elements of the game Load Slug Trail Example File on Scratch 1.4 http://code-it.co.uk/wpcontent/uploads/2015/05/slugtrail.sb Play the game without showing pupils the code (presentation mode, top right). Ask pupils to work in pairs to identify (decompose) all the features of the game. (Moving, follow mouse, leave trail, make sound if leave road, roads, instructions etc.) Ask them what they will need to make, and what they will need to make it do? Pupils can record their decomposed elements in their pupils workbooks page 12 or decompose verbally as a class. Collate their decomposed elements on a board in the class or suite so it can be referred to during the project. A nice touch is to include initials for pupils who first tell you an element. When you get to build these later you can refer to 'Adina's moving slug' or 'Ben's track'. 2. Drawing the Slug Click on the paint new sprite button. Draw slug using ellipse tool for the body, the line tool for the antenna Common Bugs Line is not drawing from underneath the slug
and the pen tool for the ends of the antennae. Make sure you draw it facing right or it will travel in the wrong direction.
Common cause Pupils have included a dot away from spite when painting it
Set costume centre button
Fix Edit sprite, delete dot and then re centre sprite using set costume centre button at bottom of paint editor
76
The blue line shows direction of travel
Chapter
2
3. Moving Block Explain that they are now going to make their slug move continuously. Link this to their decomposed list. If this is the first time pupils have encountered forever loop show them everyday examples http://code-it. co.uk/wp-content/uploads/2015/05/foreverloops.pdf. Drag out these blocks of code and encourage them to snap these together and click the green flag. When they get it right the slug will shoot across the screen. If they don't get it right re-assemble it and try again. As pupils get their slugs to move, challenge them to reduce the speed without adding any extra blocks. After they solve this by reducing their move 10 steps block to a smaller number. Drag out the point towards block and select the mouse pointer from the menu triangle. Can they find a place for this block so the slug moves continuously towards the mouse pointer? Once they have got the code working, model what is happening physically by pretending to be the slug. Start off by moving across the room saying move one step repeatedly, reach the wall and continue to try to move just like the slug in the first stage before the point towards the mouse pointer block is introduced. Then invite a child up to be the mouse pointer and instruct them not to be caught by you. Move one step and then change direction to point towards the mouse pointer/ child repeatedly. The slug will then chase the mouse pointer/child. If a child asks why the slug seems to shake when it catches the mouse pointer put a sheet of paper on the floor and explain that this represents the mouse pointer. Now move one step over the paper and then turn round to point towards the paper/mouse pointer. Repeat this to make the point. 3a. Moving Backwards Can pupils change the block so the slug travels backwards without adding any extra blocks? Answer is to change move 1 step into move -1 step. 4. Slug Trail Go back to the decomposed planner and find the references to the slug trail. Can anyone think of a coding block that they can use to draw lines? If you completed the Smoking Car they may remember the pen down block. If not drag the pen down block out and ask pupils if they can find a place for it so it gets run once only.
77
Chapter
2
Many pupils will put it inside the forever loop. Point out that this works but that it is not the most efficient coding as the pen down runs over and over inside the loop. Next drag out the clear block and ask pupils to find a place to put it so that when the game is started all the previous lines will be cleared. Sometimes pupils will drag out another green flag block and place the clear in its own block of code. This is a perfectly valid solution. Popular Solution 5. Pen Blocks Experimentation Encourage pupils to save their work at this point. Explain that if they make any bugs that are difficult to fix they have a working copy of the game to restore/bring back. Now point to the pen blocks and encourage pupils to experiment with them. Can they set keys to change the colour? Can they draw a multicoloured line? What happens with some of the blocks if used inside the loop as well as before it? Does all the code need to go inside the main block?
A possible multi-coloured solution.
Note
Many pupils will put these colours
The change pen size by block if put in a loop will very quickly grow the pen size to cover the whole screen. If a pupil does this they can fix it by dragging out the set pen size to 1 and double clicking on it.
into the main move loop but the addition of waits in there will stop the moving blocks from working properly. (Hint card available.)
Don't forget however, to remove the original change pen size by block! Can they explain to you why it has happened?
Possible pen colour solution
78
Chapter
2
6. Create Roads Remind pupils of the roads they created in the smoking car game. Remind them how to select stage then backgrounds tab and then edit to draw a slugway trail. Some may need a reminder of the copy button to draw multiple slugway trails. Same colour backgrounds The most important thing is that they must keep all the backgrounds exactly the same colour as they will be using the colour to code later. Note Warn pupils that sprite should not be same colour as the road or background to avoid the slug looking like it has disappeared. 6. Off road leads to sound Give pupils 2 minutes to import an annoying sound such as screech (which you can find in Sounds tab, import, electronic, screech.) Now drag out an if selection block and insert a touching colour block as shown. Click in the colour and then onto the background colour to change the colour. Remind pupils that this selection block will only play the sound if it is touching the colour. Drag the slug so that it is touching the background colour. Explain that you can run one block just by mouse clicking on that block once. Ask pupils if screech will play when you mouse click on it. Repeat the process when the slug is not touching the background colour. This condition will only be checked once. Ask pupils where they could put the code so it gets checked over and over and over again. This can either go in its own forever loop or inside the move forever loop.
79
Chapter
2
8. Extensions & Instructions Change Background (easy) Challenge pupils to see if they can work out the right code to make x key change background. Code must go in stage area. Solution
Stop All (Easy) Can pupils create a keyboard input that stops all code?
Use Hint Cards (p82) to help pupils choose useful blocks if they are struggling Increase Pen Size (Hard) When decomposing the project some pupils will have noticed the pen size increasing slowly over time. Can they remake this? I often drag the blocks out unconnected as a starting point. (Hint card available p82.)
Increase pen size solution
Instructions (Middle) Help cards are available for this. Create new Sprite called instruction Text Size 24 Zoom Out Drag text to top left corner of screen Type out instructions Add code to show when game starts or i key is pressed (Hint card available p83).
80
Chapter
2
Generalising if else within a loop (Middle) A really nice extension is to ask pupils to program the slug so that it says one thing when touching the road and another if touching the background colour. You can introduce the blocks above as a hint for anyone who needs them (Hint card available p82.) At the end don't forget to go back to your decomposed list. Ask the pupils if they found it helpful to break up all the jobs and solve them separately.
Print extra independent extension activities in the pupil books and send them home
81
Chapter
���������� Photocopy, cut up and use if and when needed.
����������l�����
Muli-��l�u����l���
�����u�i���
���������������l��� M����������ll���������u��
82
2
code it.co.uk
Scratch Slug Trail Help Card
83
code it.co.uk
Part 1 Create the Sprite Create a list of Instructions Paint Paint newnew sprite sprite Text Tool Text Tool
Font Size 24
Zoom out Font Size 24
Zoom Out Type Type Instructions
Instructions
code it.co.uk
Chapter 3 - Slug Trail Game
3C. Slug Trail Game Avoid the hideous screeching sound by making sure your slug stays on the path.
Computational Thinking Decomposition Start by breaking down the game into all the things you will need to make and all the things you will need to program it to do. Conditional Selection within a loop A normal conditional selection block only checks the condition once. Put it inside a loop and it will check the condition over and over again. I think you have got the idea!
Can you think of any other everyday conditional selection choices which could be put inside a loop? Would this always work everywhere?
Challenge Yourself At Home Ask a parent or guardian if you can download Scratch 1.4 and install it on your computer or iPad. You can find the download a thttps://scratch.mit.edu/scratch_1.4/. On the iPad download Pyonkee. First Steps
Can you draw your own pen or pencil sprite? Can you make it follow the mouse? (HINT Set costume centre)
Next Steps
Can you make it draw lines and change the colour and size of the lines when different keys are pressed?
Further Steps
Can you make it stop or start drawing lines? How useful is it to draw things on the screen? How could you make it draw a better picture?
Describe your project here What did you enjoy doing? Did you discover any new effects? Did you struggle with anything? Remember all programmers make mistakes (bugs) and the best ones keep trying to find a way to fix things!
10
Coding Workbook Two - Choices
Chapter 3 - Slug Trail Game
Learning Intention: I am learning to code a Slug Trail Game Success Criteria:
How did I do?
I can decompose the parts of the game with a friend I can make my slug move I can make my slug draw a line when it moves I can draw a road background I can program so that if the sprite touches a colour it makes a sound I can make a key change the background I can fix (debug) any errors Extension I can change the pen colour I can make a stop all key I can make the slug draw a multi-coloured line I can program the slug to say one thing when within the line and another when outside (generalise) I can write a set of instructions for the game User I can increase the pen size as times goes by Challenge I can think how I might improve the game… wk1
I can do it
wk2
wk3
Teacher use only
I did it a bit but didn’t fully get it I didn’t get it at all Coding Workbook Two - Choices
11
Chapter 3 - Slug Trail Game
Decompose Slug Trail Game Decomposing Means Breaking a complex problem up into parts and solving these separately What will I need to make?
12
What will I need to make it do?
Coding Workbook Two - Choices
3
Counting Machine by Phil Bagge Chapter Designed for Year 5+ pupils who have used Scratch Before. Uses Scratch 2.0 From How to teach primary programming using Scratch by Phil Bagge code-it.co.uk
3A. Counting Machine Module Aim: Create and adapt a counting machine.
Time to complete module 3 hours
Module Learning Focus By the end of the module children will be able to: -
Solve simple maths problems using Scratch code
- Understand the benefit of changing a variable within a loop
National Curriculum Programs of Study Pupils should be taught to: s DESIGN WRITEANDDEBUG
- Investigate and modify a simple program that changes a variable
PROGRAMSTHATACCOMPLISH
-
SPECIlCGOALS including
Begin to look for ways to generalise this idea elsewhere
Computer Science Concepts:
controlling or simulating physical systems; solve
-
Repeat x times loops
problems by decomposing
-
Variables in a loop
them into smaller parts
-
Reporting a variable by using it within a say command
s USESEQUENCE selection, andREPETITIONINPRO
Maths Concepts
GRAMSWORKWITHVARIABLES
- Counting in multiples, counting backwards, counting in halves, counting
ANDVARIOUSFORMSOFINPUT
in tenths, counting in hundredths, counting from a different starting number
Assessment for Learning At the end of each session direct pupils to page 8 of pupil workbook 3 to help them reflect on what they have learnt. It is often worth working through this line by line to avoid pupils filling in everything with a smiley face. You can also annotate this to record pupils who have needed much more support or have demonstrated greater understanding.
Adult Focus All adults need to be clear that they are to support using hints only and not solve things for pupils.
Computational Thinking - Evaluation is how we look at algorithms and determine how useful they are, how adaptable, how efficient, how correct. There may be many algorithmic solutions to a problem, evaluation asks which one was best and why?
ANDOUTPUT s USELOGICALREASONINGTO explain how some simple algorithms work and to DETECTANDCORRECTERRORSIN ALGORITHMSANDPROGRAMS
Useful Hints Help pupils understand counting down as repeated subtraction as counting up is repeated addition https:// youtu.be/Kdg41Tr6ZaQhtml. Pupils trace step by step what is happening to the number in the loop. Resources Pot or mug Lots of pencils Post-it note
93
Chapter
3
9. Broadcast End 7. User input 3. Evaluating
5. Challenges
solutions 1. Can the cat count?
Learning Path
4. Plan & build similar algorithm
6. 30 second Count down timer
8. Add a timer to quiz
2. Discovering the Algorithm
1. Can the cat count? Ask pupils if they can work out a way to make the cat count. They will often come up with lots of say commands strung together. Welcome their efforts and ask them what the draw backs are for this method (very time consuming). If they don't come up with this ask them if they would be happy to make the cat count to 1000 using their method? 2. Discovering the Algorithm Remind pupils of when they created a variable to hold the score in the maths quiz. Bring back to mind the two useful variable blocks, set variable and change variable. Model emptying the pot and filling it with 0 or a set number of pencils as you set the variable to whatever the number is. Ask them where they set the variable to 0 in the quiz. Answer at the start, so each quiz was fair and the score wasn't carried over if you attempted the quiz a second time. Now model changing the variable by 1 inside a repeat loop. Give the pupil helper the variable pot, label its count using the post-it note. Set the variable to zero by removing all pencils. Now model changing the variable by 1 by putting a pencil in the pot. After each change get the student to look into the pot/variable and report the number of pencils. Ask pupils what this repeated process of changing the variable by 1 and saying the variable could be inside. Most groups will come up with a loop. Now give pupils more time to see if they can come up with a better way to count using what you have just modelled. There are videos video illustrating this at http://youtu.be/VsHmGgkYQK4 and http://youtu.be/_26bc5twFRg
94
Chapter
3
You may need to remind pupils how to create a variable in Scratch 2.0 Data Make a variable Variable name: Count For all sprites OK
3. Evaluating Solutions Typical pupil solutions may look like this. This is a really good opportunity to evaluate both the sequence of say commands and this changed variable inside a loop. Which is most efficient? Which uses the least code to count to 1000?
4. Plan and Build Similar Algorithm Explain that a computer scientist has come up with a similar version of their counting algorithm. Ask them to turn to page 9 where they will need to match the Scratch blocks with the algorithm flow chart. The correct matching blocks are on page 99. Once they have completed this they can build the new counting machine in the scripts area of a new sprite. It can be tempting to let them use their old solutions but these often have flaws, such as using a forever loop, that make them less useful for counting and it is a useful skill to read and interpret a flowchart algorithm.
95
Chapter
3
5. Challenges As pupils finish building and testing their counting machine encourage them to work their way through the challenges found on page 10 of the pupil workbook and come and point out what they changed to solve this on the challenges sheet (page 99) of the teacher workbook. Challenges Count faster, count in 2s, count in 7s, count backwards, count in halves, count in tenths, count in hundredths, start from 30, start from -60. Combine previous challenges: for example start from 100 count backwards in 7s. Counting Challenges Answers
Start counting from 30 change set variable to 30, start counting from -60 set variable to -60 Count faster change seconds to decimal fraction such as 0.5 Count in 2s change variable to 2, count in 7s change variable to 7, count backwards change variable to negative number, count in halves change variable to 0.5, count in tenths change variable to 0.1, count in hundredths change variable to 0.01,
6. Countdown timer As pupils finish the challenges explain that you would like them to program a 30 seconds count down timer that you can use in class for mental maths. Can they adapt their counting machine to do this? Can they make sure that it alerts everyone when it finishes? This is one possibility but there are many variations on the ending.
96
Chapter
3
7. User Input Explain that the teacher would like to be able to set the timer so that they can determine how many seconds it runs for. Ask if they can remember a way of inputting user information into a programme while it is running. If you covered the quiz someone should remember the ask command. Drag out an ask command and ask where the user input goes. Draw out that it goes into the answer block. Can we use this to set the time? Very few pupils will solve this without hinting that ask can input into more than one answer block. I recommend dragging out another answer block after a period of struggle.
The use of the say command is an optional extra and can be suggested as an extension if pupils don't arrive at it independently.
8. Add a timer to the Maths Quiz If your pupils previously created the Maths quiz an interesting extension is to require them to add a timer to their quiz. 9. Broadcast End An enjoyable extension to this is to recap how broadcasts can be made to trigger multiple events elsewhere in the program and then suggest they use this in as many ways as they can to indicate that the timer has finished. https://youtu.be/BwFT6dYAUz0
We hope you enjoyed using these resources. There are 100s of other primary computing science resources at code-it.co.uk Phil Bagge 97
Chapter
3
Match the Scratch blocks to the flow chart by drawing lines to them
Tick the two blocks that get repeated 12 times
98
Chapter
3
Point to what you changed
99
Unplugged: Maze by Nic Hughes Overview Time: 45min - 1hr
Age Group: KS1/LKS2
Children will program each other to move around a maze drawn/marked out on the floor.
Resources Paper, Pens, space in a room to map out simple maze/route, something to mark floor, duct tape, chalk etc... (see appendix 1 maze design image for an example)
Learning Objective Can I create an algorithm to move around a maze?
Success Criteria I can write a set of clear instructions.
Teacher Input Today we are going to move around a maze. Get a volunteer and blindfold them. Get class to give instructions to program him/her to move around the maze. Which is marked out on the floor using tape. They have to follow the instructions they are given exactly. (Chat to child beforehand to make sure they follow instructions exactly.) Can they move around a maze? What are we learning about giving clear instructions? Develop movement vocabulary as they work. Agree as a class on some set commands. What forward one step means, what turn right means etc… Repeat. Repeat with more than on child.
Activity Children to work in groups of 2/3. Children to record a series of instructions to give to someone to get them around the maze. They have to be as precise as possible. Challenge the children who can do it in the least instructions? Don't let them test it out there programs initially, they should predict and work it out base on the earlier test.
Plenary You have all been writing programs. Review and test some. Get the children to demonstrate their algorithms. Do we need to make any more improvements. Discuss the shortest program? Why? EXT: This could lead nicely into a activity with robots either on the floor or onscreen. It also ties in nicely with LOGO.
29
Unplugged: Maze by Nic Hughes Assessment Suggestions How efficient is the program? Could it be done in less lines/instructions? Get children to explain what their program does.
Appendix 1
30
Creating Kodu by 3BM
Creating a Kodu Programming on-screen object(s) Lesson 1 of 5/6 Year 3
Computing curriculum reference Design, write and debug programs that accomplish specific goals, including controlling or simulating physical systems; solve problems by decomposing them into smaller parts. Use sequence, selection, and repetition in programs; work with variables and various forms of input and output. Use logical reasoning to explain how some simple algorithms work and to detect and correct errors in algorithms and programs.
3BM summative assessment record Year 3
Demonstrates logical 'trial and error' when using a computer simulation, 'model' or game, and predict the consequences of decisions/choices made. Can produce an accurate set of simple instructions (code), to program (control) an on-screen object (or floor 'robot'), using trial and error to debug. Can also talk about how the sequence of events in some simple instructions (algorithms) or code are 'working'.
Associated resources and links Software
Kodu Game Lab: http://www.microsoft.com/en-us/download/details.aspx?id=10056
Additional
Official Kodu site with further resources: http://www.kodugamelab.com/ Kodu Cards Example Final Game (Kodu Saved File). Win Condition https://www.youtube.com/watch?v=jKGK1uePenk Lose Condition https://www.youtube.com/watch?v=hrbniksaiuI
© 3BM Education Partners 2015 This resource is provided for use by schools who have purchased the 3BM curriculum resources and should not be distributed to others or reproduced without prior permission of 3BM.
31
Creating Kodu by 3BM Prior to the lesson Teacher
Ensure that the software has been installed so available to all computers. The software can be set to run in full screen or a window. Kodu is used with a mouse and keyboard but is even easier to use if have wired XBOX controllers. http://www.xbox.com/en-GB/xbox-360/accessories/controllers Note: Kodu uses the work kode (for code). Explore the software and complete all the tasks that the children will work on prior to teaching the lessons. I.e. the Lessons ‘First Tutorial’, ‘Add/Paint Terrain Tutorial’, ‘Programming Kodu to find Apples Tutorial’, ‘Score Tutorial’.
Expectations / outcomes Developing
Some children will be able to program an object to respond to simple inputs from a keyboard or mouse and collect objects, with help.
Expected
Most children will be able to create a simple game by creating a ‘world’ and programming objects to respond to their environment though reaction to inputs and selection (IF/ELSE). They will de-bug errors.
Exceeding
Some children will have progressed further developing a more complex game with several objects and a scoring variable to their program. They will be able to evaluate a game to assess what could improve it.
Lesson 1 - Teacher activities Introduction to Kodu
Tell
class that over the next few lessons they are going to be making a game using ‘programming skills’. That they are going to be learning how to ‘program’ a Kodu onscreen to move when given instructions.
Link
back to previous work they have undertaken with programmable toys like Beebot or Probot and ask / remind class how they gave the floor robots step by step instructions, also reminding them of term algorithm.
Demonstrate how to open the software and load the ‘World First Tutorial.’ • •
On the main menu select ‘Load world’. On the new screen highlight ‘Lessons’ along the top and then scroll along until you find ‘First Tutorial’.
NOTE: You can follow the tutorial when you first use the software but we advise that you to exit the Tutorial when you demo to the class.
32
Creating Kodu by 3BM Demonstrate
how to add a Kodu to the world and add controls to make it move around. NOTE: The steps to do this are demonstrated in the tutorial.
Demonstrate
Show class how to exit the Tutorial after viewing the instructions. Click on the ‘Exit Tutorial’ button. NOTE: While some may be able to follow the tutorial we would really advise you to encourage the class exit it and follow the instructions that you have already given.
Lesson 1 - Pupil activities Access
Kodu and select ‘LOAD WORLD’ and load ‘First Tutorial’. Remind pupils to exit the Tutorial after viewing the instructions. Click on the ‘Exit Tutorial’ button.
Complete
the activity, to add a Kodu to the world and add controls to make it move around.
Challenge
class to add a second character that will move using different inputs, such as different keys or the mouse.
Lesson 1 – Teacher plenary Showcase
solutions to the challenge.
Discuss
the problems they came across and how they were, or can be, overcome.
© 3BM Education Partners 2015 This resource is provided for use by schools who have purchased the 3BM curriculum resources and should not be distributed to others or reproduced without prior permission of 3BM.
33
Scratch: Starting with Scratch by 3BM Programming Lesson 1 of 4 Year 5
Computing curriculum reference Design, write and debug programs that accomplish specific goals, including controlling or simulating physical systems; solve problems by decomposing them into smaller parts use sequence, selection, and repetition in programs; work with variables and various forms of input and output Use logical reasoning to explain how some simple algorithms work and to detect and correct errors in algorithms and programs
3BM summative assessment record Year 5
Can test, debug and edit a program that accomplishes a given goal, (simple computer 'game' or model or simulation), to solve a problem. Can create an accurate program to accomplish a given goal, including the use of repetition (loops), selection (IF/ELSE) and variables. Can use logical reasoning to deconstruct programs, evaluate their effectiveness and make them more challenging and / or 'elegant' / efficient. Can use different types of input options and output options such as through sensing and control 'kits' and/or software, to solve a problem. Developing and using a wider computing 'vocabulary' in context of task, such as search engine, URL, variable, validate, digital footprint, spam, Wiki, etc.
Associated resources and links 3BM
Help Video: Create a Fish Tank Animation https://www.youtube.com/watch?v=_feMfxqUnTY Help Video: Make a Fish Tank Game https://www.youtube.com/watch?v=3lMQCfvbifk Help Video: Traffic Light Solution https://www.youtube.com/watch?v=rgjGAagmxCk Traffic Lights - Scratch File Traffic Lights with Switch - Scratch File Scratch challenges: teacher resource
Software
Scratch 2 Offline Editor - http://scratch.mit.edu/scratch2download/ Scratch – Web version is online at http://scratch.mit.edu/
34
Scratch: Starting with Scratch by 3BM Prior to the lesson Teacher
Ensure that the software has been installed on all computers. You will need to choose which version of Scratch you want to use. We recommend you use the Scratch 2.0 Offline Editor as this requires no usernames or passwords. This is the version demonstrated in the help videos. The website version http://scratch.mit.edu/ can be used without a username and password by selecting ‘create’ on the top toolbar. Projects can be downloaded and saved directly from the site without pupils needing to log in via the file menu. (If you want pupils to share work online pupils will need to create an account). Before teaching any lessons explore the software and complete all the activities you will be doing with the children. If showing any YouTube video – have loaded and skip advert before playing to class.
Expectations / outcomes Developing
Some children will be able to programme a sprite to move and respond to simple inputs. They will achieve other programming tasks with direct help.
Expected
Most children will be able to create a simple game by programming sprites to respond to their environment though selection and responding to inputs. They will be able to sequence, repeat and change some events and debug and refine their work. With some help they will add a variable such as a score. They will be able to explain what a piece of script used, does.
Exceeding
Some children will have progressed further and create more complex outcomes, with independence. They will be able to find more efficient (or elegant) ways to achieve a task / solve a problem. They will explore other programming options and apply them to make a more interesting result or challenging game. They will be able to evaluate work providing good ideas for improvement.
Lesson 1 / 2 - Teacher activities Introduction to Scratch Ask
What the words algorithm and programming mean? Discuss based on pervious work that children have done. (Kodu in Year 3 and 4). What algorithms have you followed? What have you programed computers to do?
Revisit
briefly, what objects around us are programmed?
Discuss
with children and brainstorm things in the world/school that are programmed.
35
Scratch: Starting with Scratch by 3BM Explain
over the next few lessons we are going to be learning how to use Scratch to produce animation and games.
Demonstrate
how to create a fish tank animation. Demonstrate how to add a stage, add sprites, add movement scripts, add animation scripts, add sound. View the help video, Creating a fish tank animation, to learn how. You can just play the video to the class as well but make sure you have completed the task before the lesson. As you build the animation ask the children to predict what will happen when you change the scripts and in particular change the numerical variables. You may need to do this step by step depending on the ability of the children.
Lesson 1 / 2 - Pupil activities Access
Scratch and follow the demonstration to create a simple fish tank animation.
Complete
the animation - add a stage, add sprites, add movement scripts, add animation scripts, add sound.
Challenge
the children to see if they can add a new sprite which can be controlled around the screen.
Remind
Children to save their work. They will need it next lesson. You may wish to spend 2 lessons depending on the ability of the children and how much of lesson 2 you wish to introduce.
Lesson 1 / 2 – Teacher plenary Discuss
with children what various scripts accomplish.
Show
scripts that have been created this lesson, what do they do?
Discuss
solutions to the challenge.
© 3BM Education Partners 2015 This resource is provided for use by schools who have purchased the 3BM curriculum resources and should not be distributed to others or reproduced without prior permission of 3BM.
36
Kodable Lesson Plan 1 - Sequencing. It's very important that algorithms (instructions) are clear and in order. The sequence has to be correct to run a program. This is where Kodable comes in. It's a fantastic app for pupils who want to develop their skills in sequencing and ordering with algorithms. Computing outcomes: • Follow, describe and represent a sequence of steps and decisions. • Analyse and debug an algorithm that includes sequencing and simple loops. • Write a program, debug, test and predict.
Curriculum outcomes: Maths/Numeracy. • Understand and use a range of positional words. English/Literacy. • Follow/give instructions. • Recall sequence and detail.
Introduction - 10mins. It's always good to begin with an unplugged coding activity. To get the session started, play 'The Directional Game.' This time, blindfold one of the pupils and ask other pupils to give them directions to move safely around the classroom. (Use the directions forward, back, left, right.) Main Activity - 40mins. Ask pupils to go in to the Kodable app. Ask them to access the Smeeborg World and go to the Sequence Sector Level. Go through Level 1.1 and show pupils how to drag the directional blocks at the top right of the screen across to the program area in the top left of the screen. Highlight that they have to be put in the correct order and very specific to ensure that Fuzz ball moves through the maze. Pupils will then tap the 'Play' button to run the algorithm. Give pupils the opportunity to move through each activity in the Sequence Sector Level. Set them a challenge to see who can complete the activities first. Plenary - 10mins. Select random activities within the Sequence Sector Level, put them up on the Interactive Whiteboard and ask pupils to come up with the correct code for each Fuzz ball. To develop problem solving skills, put up an algorithm with a mistake in it and ask pupils to identify it and solve the problem, prompting them to come up with the correct algorithm.
iTeach
www.iteach-uk.com
Jigsaw by Neil Smith Outline of Lesson In this lesson, pupils will work through the worksheet and produce their own digital jigsaw puzzle. They can exhibit their creativity by picking their own images. Pupils are able to extend the project if they finish on time. This activity links to the national curriculum for computing’s objectives of “design, write, and debug programs; solve problems by decomposing them; use sequence, selection, and repetition in programs; work with variables.”
Suitable for: Upper KS2 and above. Lesson Length: 1–2 hours.
Resources Required: This project should be carried out with Scratch (http://scratch.mit.edu ). You should check that Scratch runs in web browsers on your computers. Tablets such as iPads aren't suitable for this project. You will need to print out sufficient copies of the worksheet for your pupils.
Objectives • •
I can use user-interface events to control a program I can use variables to control how a program behaves
Success Criteria • •
Pupils create a jigsaw puzzle game. Pupils can extend the puzzle for different numbers and shapes of pieces.
Jigsaw In this project, you'll use Scratch to make a jigsaw puzzle.
We'll start by making one piece of the jigsaw, then duplicate it to make all the others.
Step 1: Make the pieces and costumes 1. Find the image you want to make the jigsaw from. Some of the costumes are “vector” graphics, which makes theme easy to split. Select a costume using the “Type: Vector” selector. 2. Use the “ungroup” tool and split it into a bunch of costumes, one for each piece of the jigsaw. Delete any parts you don't want. 3. Duplicate the sprite a few times, so that you have one sprite for each part of the picture. For the dinosaur, I had pieces for the body, front legs, back legs, tail, and eyes. 4. Pick a background that suits your picture.
Step 2: Pick up and put down a piece When you click on a jigsaw piece, you'll “pick it up” so it can move. When you click on it again, you'll “put it down” and it will stay there. Start with the biggest or most central piece. 1. In the Costume tab, use the “Set costume center” tool to put the centre of the costume in in the middle of the picture. 2. Back in the Scripts tab, make a new variable for all sprites called selected. 3. Add these two scripts to the sprite.
Test your project. The piece should change colour and be a bit transparent when you click on it, then go back to looking normal when you click it again.
Step 3: Make the picked-up piece move Now we want the pick-up piece to follow the mouse pointer. 1. Add this script to the same piece as before.
Test your project: Click the piece. Does it follow the mouse pointer? Does it stop following when you click it again?
Step 4: Fix the piece when it's in the right place Now we can move pieces, we want them to “click” into place when we put them near enough to where they should go. We don't want the piece to move again once it's been placed, so we'll stamp the costume onto the background then hide the sprite. 1. Modify the script from above to include this new part.
You might find it easier to build up the big green expression piece by piece, then put it all together. Start with the bottom row then merge them as you go up.
Test your project. Does the piece “snap” into place when you drag it to the right place? Can you move it again afterwards? When you press the green flag again, does the game start properly? (We'll fix that next.)
Step 5: Make the puzzle start When the puzzle starts, we want all the pieces to appear and drift to random places. 1. Add this script to the sprite.
2. Add this script to the stage.
Test your project. Does the puzzle start again when you press the green flag? Does the piece move to a different position? Can you pick up pieces again?
Step 6: Do all the other pieces The jigsaw has more than one piece. Copy all four scripts to each other jigsaw piece. (Or duplicate the sprite and remove the other costumes, depending on how you've done it. You need to make some changes to all the other pieces. 1. Change the name of the jigsaw piece both times it's used. 2. Change the positions of the piece when you work out if it's in the right place. Look up in the top left of the Scripts pane to see the current position of the piece. The x position numbers in the if should be 20 apart, as should the y position numbers..
Test your project. Do all the pieces move? Do they all snap into the right place? If you've picked up one piece and then click on another, do you pick up the new piece and drop the old one?
Extension: Make the pieces turn When you start the game, make all the pieces turn a random amount. When a piece is selected, make the left and right arrow keys turn the piece. Hint: use an if under a when [ left arrow ] key pressed hat. Only allow the piece to snap into place when it's at the correct angle as well as the correct position. IF you get a “That name is already in use” error when creating a variable, make sure the variable is “for this sprite only”
The following two activities have been provided by CoderDojo. CoderDojo is a volunteer led movement of free, after school coding clubs for young people aged 7-17. You can learn more here: www.coderdojo.com !
!
+" In partnership with
Copyright"©"2016"Codeweek.UK""