Coding

Download Subtitles

Transcript

0:00:05 > 0:00:08# If you've got a question and you don't know where to go

0:00:08 > 0:00:11# Ask Nina for some help Cos she's got a science show

0:00:11 > 0:00:14# She makes sense of her senses While helping all her fans

0:00:14 > 0:00:17# By doing her experiments with potions and with bangs

0:00:17 > 0:00:19- # Touch your tongue.- Tongue!

0:00:19 > 0:00:20- # Fingers.- Fingers!

0:00:20 > 0:00:23- # Eyes.- Eyes! - Ears.- Ears!- Nose.- Nose!

0:00:23 > 0:00:27# Nina and the Neurons find out what you need to know

0:00:27 > 0:00:30# Nina and the Neurons find out what you need to know

0:00:30 > 0:00:32# Luke, he helps us with our eyes and Felix with our touch

0:00:32 > 0:00:35# Ollie sniffs out smells and scents And Belle, she hears so much

0:00:35 > 0:00:38# Bud is Ollie's brother He helps us with our taste

0:00:38 > 0:00:41# They're Nina's little Neurons And they're coming to your place!

0:00:41 > 0:00:43- # Touch your tongue.- Tongue!

0:00:43 > 0:00:44- # Fingers.- Fingers!

0:00:44 > 0:00:47- # Eyes.- Eyes! - Ears.- Ears!- Nose.- Nose!

0:00:47 > 0:00:50# Nina and the Neurons find out what you need to know

0:00:50 > 0:00:53# Nina and the Neurons find out what you need to know

0:00:53 > 0:00:54# Oh, yeah! #

0:00:56 > 0:00:59Erm... Was it? Oh. Oh, hello there.

0:00:59 > 0:01:04Now, I thought I'd finished making this chair, then I found this.

0:01:04 > 0:01:08I must have missed something out of the instructions.

0:01:08 > 0:01:11Erm... Oh, I wonder where it's supposed to go.

0:01:11 > 0:01:12Oh.

0:01:14 > 0:01:17- Found it! - BEEPING

0:01:17 > 0:01:21I hear a beep, I see a flash. I wonder what they're going to ask.

0:01:23 > 0:01:26- Hi, Nina.- Hi.

0:01:26 > 0:01:31- We've got a question for you. - Computers can do amazing things.

0:01:31 > 0:01:35- How do they know what to do? - That's a great question.

0:01:35 > 0:01:39Computers can do amazing things. How do they know what to do?

0:01:39 > 0:01:42We use computers for absolutely everything.

0:01:42 > 0:01:46They are amazing machines that make our lives easier every day.

0:01:46 > 0:01:48Come down to my lab and investigate.

0:01:48 > 0:01:52- See you soon, Nina. Bye.- Bye.

0:01:52 > 0:01:55Well, I'm going to need some help to answer this one

0:01:55 > 0:01:57and I know just who to ask.

0:01:57 > 0:01:59OK, Neurons, time to get to work.

0:02:14 > 0:02:17ALL: Neurons at the ready, Nina.

0:02:17 > 0:02:21OK. Today's question is, computers can do amazing things.

0:02:21 > 0:02:23How do they know what to do?

0:02:23 > 0:02:28Which Neuron will be most useful in helping us find the answer?

0:02:28 > 0:02:33- It's all Neurons! - ALL: Go, Neurons! Go, Neurons!

0:02:33 > 0:02:34Go, Neurons! Go, Neurons!

0:02:34 > 0:02:38Go, Neurons! Go, Neurons! Go Neurons!

0:02:38 > 0:02:41All Neurons hip, hop, happy to help, Nina.

0:02:41 > 0:02:44Today's question is - computers can do amazing things.

0:02:44 > 0:02:46How do they know what to do?

0:02:46 > 0:02:49Now, when we use a computer, we need all our senses,

0:02:49 > 0:02:52so all the Neurons will be helping us today.

0:02:52 > 0:02:57Right, I need to get the lab ready before the experimenters arrive.

0:02:57 > 0:02:59Caleb likes playing football.

0:02:59 > 0:03:01Kennedy likes chicken and chips.

0:03:01 > 0:03:04Sarah loves gymnastics at school.

0:03:04 > 0:03:06My computer can play music.

0:03:06 > 0:03:09I like playing games on my computer.

0:03:09 > 0:03:11I can draw on my computer.

0:03:13 > 0:03:16But they all want to know - computers are amazing.

0:03:16 > 0:03:18How do they know what to do?

0:03:18 > 0:03:22So today, for one day only, Caleb, Kennedy and Sarah

0:03:22 > 0:03:24become the experimenters!

0:03:26 > 0:03:28- Hi, guys.- Hi, Nina.

0:03:28 > 0:03:31Welcome to my lab and thank you for your question.

0:03:31 > 0:03:35Computers can do amazing things. How do they know what to do?

0:03:35 > 0:03:38To find out the answer, let's start by using our senses.

0:03:38 > 0:03:43ALL: Whoop whoo! A senses experiment! We're ready, Nina.

0:03:43 > 0:03:46First, let's think about how we know what to do.

0:03:46 > 0:03:50Quite often, people tell us what to do. They give us an instruction.

0:03:50 > 0:03:53Like telling us to tidy our room.

0:03:53 > 0:03:55Computers always have to be told what to do

0:03:55 > 0:03:59because they're not people and they can't think like we can.

0:03:59 > 0:04:03- When you tell a computer what to do, it's called coding.- Coding.

0:04:03 > 0:04:06That sounds important, Nina.

0:04:06 > 0:04:08Coding is very important, Belle.

0:04:08 > 0:04:11It's the instructions for the computer.

0:04:11 > 0:04:14And the exciting thing is, anyone can learn how to do it.

0:04:14 > 0:04:19Let's do an experiment to understand more about coding.

0:04:19 > 0:04:23So in front of you, you each have a white board and a pen.

0:04:23 > 0:04:25Now, we're going to draw a picture

0:04:25 > 0:04:28and I'm going to give you instructions on what to draw.

0:04:28 > 0:04:29Are you ready?

0:04:29 > 0:04:35- Yeah!- OK. First of all, I would like you to draw a big circle.

0:04:38 > 0:04:41Next, I'd like you to draw two smaller circles

0:04:41 > 0:04:43inside the big circle.

0:04:47 > 0:04:49Now I'd like you to draw a straight line.

0:04:49 > 0:04:53And finally, I'd like you to draw an upside-down rainbow shape.

0:04:57 > 0:05:01OK, experimenters. Let's see what you've drawn.

0:05:01 > 0:05:03I'm not sure what the drawings are.

0:05:03 > 0:05:09I think it's a plate with grapes and a curvy banana. Yum!

0:05:09 > 0:05:12Well, that's not quite what I meant.

0:05:12 > 0:05:16I wanted you to draw something more like...this.

0:05:16 > 0:05:19- My instructions didn't work, did they?- No.- No.

0:05:19 > 0:05:21And why do you think they didn't work?

0:05:21 > 0:05:24- We didn't know it was meant to be a face.- That's right.

0:05:24 > 0:05:28I gave you instructions, but not enough detail.

0:05:28 > 0:05:29I missed important things,

0:05:29 > 0:05:32so you didn't know it was meant to be a face.

0:05:32 > 0:05:35If you want someone to follow instructions,

0:05:35 > 0:05:39you have to give them lots of detail so they know exactly what to do.

0:05:39 > 0:05:42And in the same way, people who write computer code

0:05:42 > 0:05:45have to make sure the instructions are very detailed

0:05:45 > 0:05:47so computers know what to do.

0:05:47 > 0:05:51- Can anyone write computer code, Nina?- Great question.

0:05:51 > 0:05:55I know a really exciting place where we can find out more.

0:05:57 > 0:06:02FELIX: Oh, goodie. I love this bit. I wonder where Nina is taking us.

0:06:02 > 0:06:06- Oh, maybe we're going on holiday! - Maybe we're going to the seaside.

0:06:06 > 0:06:09Hey, everyone. We've arrived.

0:06:09 > 0:06:11But it doesn't look like the seaside.

0:06:11 > 0:06:14Now, for our next experiment, I'm going to pretend to be

0:06:14 > 0:06:16a character in a computer game.

0:06:16 > 0:06:21And you guys are going to tell me what to do using this simple code.

0:06:21 > 0:06:22Oh, now, look at this.

0:06:24 > 0:06:27So this arrow means, "move forward."

0:06:27 > 0:06:30This arrow means, "go that way."

0:06:30 > 0:06:33This arrow means, "go that way."

0:06:34 > 0:06:38The aim of this computer game is to keep me on the green path.

0:06:38 > 0:06:41But remember, a computer doesn't think for itself,

0:06:41 > 0:06:44so I can only follow the instructions that you give me.

0:06:44 > 0:06:47- So, are you ready?- Yeah!

0:06:47 > 0:06:49Let's get coding.

0:06:49 > 0:06:52- OK, what's the first instruction? - Forward!- OK.

0:06:53 > 0:06:57- And the next instruction?- Turn left.

0:06:57 > 0:06:59Turn left.

0:06:59 > 0:07:01- And...?- Forward.- Oh, forwards.

0:07:03 > 0:07:04Forwards.

0:07:06 > 0:07:08- And next?- Turn left.

0:07:10 > 0:07:13- What's next?- Forward.

0:07:13 > 0:07:16Ooh! Oh, no. I've moved off the green path.

0:07:16 > 0:07:18What went wrong, experimenters?

0:07:18 > 0:07:22- You turned the wrong way, Nina. - Yes, I turned the wrong way.

0:07:22 > 0:07:24There must be a mistake.

0:07:24 > 0:07:27But mistakes can happen when people write computer code.

0:07:27 > 0:07:31So the people that write them always have to check them.

0:07:31 > 0:07:34- So, should we check our code to see what went wrong?- Yes.

0:07:35 > 0:07:37This is a plan of the game.

0:07:37 > 0:07:41So let's go back to the beginning and follow the instructions.

0:07:41 > 0:07:44And if we think an instruction's right,

0:07:44 > 0:07:46we can put an arrow into the box.

0:07:46 > 0:07:50OK, let's start with the very first instruction, which is?

0:07:50 > 0:07:53- Forward.- Forwards. And do we think that's right?- Yes.

0:07:53 > 0:07:57Yeah, well, why don't you put that onto the first box? Excellent.

0:07:57 > 0:08:01Let's have a look at the second instruction, which is turn left.

0:08:01 > 0:08:06- Is that right?- Yes. - OK, put it on for me. Excellent.

0:08:06 > 0:08:10Now, what's the next instruction? Move forward. Is that correct?

0:08:10 > 0:08:14- Looks OK so far, Nina. - It's another move forward.

0:08:17 > 0:08:21And then it says turn left. Is that correct?

0:08:21 > 0:08:25- No, Nina.- Well, what way do you think the arrow should point?

0:08:25 > 0:08:29- Right, Nina.- Correct! The arrow should be pointing the other way.

0:08:30 > 0:08:34Now that's fixed, let's go through the other instructions

0:08:34 > 0:08:37and we'll see if there are any other mistakes.

0:08:46 > 0:08:49- Finished, Nina.- Hey! Well done. Let's try it again.

0:08:51 > 0:08:55- OK, guys. What's first?- Forward!- OK.

0:08:56 > 0:08:58Left.

0:08:58 > 0:08:59Forward.

0:09:00 > 0:09:02Forward.

0:09:02 > 0:09:03Turn right.

0:09:04 > 0:09:07Forward.

0:09:07 > 0:09:08Turn right.

0:09:10 > 0:09:11Forward.

0:09:11 > 0:09:14Forward. Turn left.

0:09:14 > 0:09:16Forward.

0:09:16 > 0:09:21Yay! We did it. Well done, experimenters.

0:09:21 > 0:09:23Your coding worked really well.

0:09:23 > 0:09:27I had all the right instructions and I made it to the finish.

0:09:27 > 0:09:33But Nina, it was a really, really, REALLY long list of instructions.

0:09:33 > 0:09:36Yes, it was a very long list, wasn't it?

0:09:36 > 0:09:38There is a way you can make code shorter.

0:09:38 > 0:09:42And there's a really fun experiment we can do to find out how.

0:09:44 > 0:09:49OK, guys. This time, the code has been written out using picture cards

0:09:49 > 0:09:52and you guys are going to follow the instructions on them.

0:09:52 > 0:09:56- But this list... It's quite long, isn't it?- Yes.

0:09:56 > 0:10:00Can you spot any patterns in our list of instructions?

0:10:00 > 0:10:02Red, yellow and green.

0:10:02 > 0:10:03That's right.

0:10:03 > 0:10:07In our code, the instructions coloured red, yellow, green

0:10:07 > 0:10:09always come one after the other.

0:10:09 > 0:10:14So instead of having to write out the same instructions over and over,

0:10:14 > 0:10:17we could just give the pattern a name and use the pattern name.

0:10:17 > 0:10:22Patterns have names that tell us about them. So I think this pattern

0:10:22 > 0:10:25should be called "Dance." So each time you see...

0:10:27 > 0:10:30..the Dance instruction, you know that it means

0:10:30 > 0:10:35I want you to do those three moves one after the other.

0:10:35 > 0:10:39So, let's rewrite the list with the Dance card in place of wiggle,

0:10:39 > 0:10:41bend your knees and superhero.

0:10:43 > 0:10:48The list is much shorter. Let's follow the code. Are you ready?

0:10:48 > 0:10:51- Yes, Nina.- Wave.

0:10:51 > 0:10:52Jump.

0:10:52 > 0:10:53Dance.

0:10:55 > 0:10:56Jump. Wave.

0:10:56 > 0:10:59Wave. Dance.

0:11:03 > 0:11:04Star jump.

0:11:05 > 0:11:06Dance.

0:11:10 > 0:11:13Yay! Well done, experimenters. That was great fun.

0:11:13 > 0:11:16Giving a name to a pattern of instructions

0:11:16 > 0:11:19can save a lot of time when you're writing computer code.

0:11:19 > 0:11:23Let's try out our code on a real computer.

0:11:27 > 0:11:28Nice one.

0:11:33 > 0:11:34Nice choice.

0:11:34 > 0:11:35Jump.

0:11:37 > 0:11:39And you get to press the green button.

0:11:50 > 0:11:52# Nina and the Neurons! #

0:11:55 > 0:11:58So, your question was, computers can do amazing things.

0:11:58 > 0:12:02How do they know what to do? And I think we've answered it.

0:12:02 > 0:12:07People give computers lists of instructions. This is called coding.

0:12:07 > 0:12:10Everyone can learn to write computer code

0:12:10 > 0:12:14so they can write programmes and tell computers what to do.

0:12:14 > 0:12:16If your computer code doesn't work,

0:12:16 > 0:12:19you have to look through all the instructions

0:12:19 > 0:12:20to find the mistake.

0:12:20 > 0:12:24When a computer programme has a group of instructions

0:12:24 > 0:12:28that always come in the same order, it's called a pattern.

0:12:28 > 0:12:32You can give a pattern a name so you don't have to write out

0:12:32 > 0:12:36the same instructions over and over so it saves you time.

0:12:36 > 0:12:41- So, I hope that's answered your question.- Thanks, Nina. Bye.

0:12:41 > 0:12:42You're welcome, bye.

0:12:44 > 0:12:48If you want to know more about the science that's all around us,

0:12:48 > 0:12:53go to the Nina section on the CBeebies website. Have fun!

0:12:53 > 0:12:57- # Go digital! - If you want to do it faster.

0:12:57 > 0:13:00- # Go digital! - If you want to do it better.

0:13:00 > 0:13:04- # Go digital! - If you want to do it faster.

0:13:04 > 0:13:06# Go digital!

0:13:08 > 0:13:13- # Computers and technology help us every day.- Yay!

0:13:13 > 0:13:17# Making our lives easier in each and every way

0:13:17 > 0:13:18# They help us understand things

0:13:18 > 0:13:20# And make it very clear

0:13:20 > 0:13:23# They make tricky tasks a piece of cake

0:13:23 > 0:13:25I want cake!

0:13:25 > 0:13:28# If you're trying to understand the world

0:13:28 > 0:13:32- # But the answer is invisible - Invisible

0:13:32 > 0:13:36# Use the power of computers

0:13:36 > 0:13:38# Switch it on, switch it on

0:13:38 > 0:13:40# Switch it on

0:13:40 > 0:13:44- # Go digital! - If you want to do it faster

0:13:44 > 0:13:48- # Go digital! - If you want to do it better

0:13:48 > 0:13:52- # Go digital! - If you want to do it faster

0:13:52 > 0:13:54# Go digital! #

0:13:54 > 0:13:58Amazing technology is all around us, making our lives faster

0:13:58 > 0:14:02and easier and giving us an even more exciting future.

0:14:02 > 0:14:06So, wherever you go and whatever you do, remember to go digital.

0:14:06 > 0:14:08- See you again soon. Bye.- ALL: Bye.

0:14:08 > 0:14:10Go digital!