Loading...
Hello, everybody, welcome to Computing.
My name is Mrs. Franzsen.
It's really good to have you here.
I hope that you are really excited to be working on some programming with me today.
Are you ready? Then let's go.
By the end of this lesson, you will be able to check a programme for errors to make sure it runs as you want it to.
Let's go through the keywords for today's lesson.
I'm going to say the keyword, and then you're going to say the word, and then I'd like you to listen really carefully while I explain the keyword.
Okay, are you ready? The first word, my turn, error, your turn.
That's great.
And error is a mistake in a programme.
Next word, here we go, my turn, test, your turn.
That's great.
To test is to run a programme to check if it is working as planned.
Next keyword, here we go, my turn, visible, your turn.
That's great.
When something is visible, it can be seen.
In the first part of this lesson, we are going to be finding and fixing errors in programmes.
Are you ready? Let's go.
When we create programmes, there might be problems when we run them.
Izzy says, "My programme is not working." Jacob says, "My sprite is going the wrong way." How do you think Izzy and Jacob are feeling? Pause the video and have a chat about that.
Good work thinking about Jacob and Izzy.
Let's look at how they might be feeling.
Their programmes are not working.
Jacob and Izzy might be feeling confused, frustrated, annoyed, sad, or puzzled.
Maybe you thought of those words.
You might have thought of some other words as well to describe how you might feel when a programme is not working the way that you think it should be working.
If a programme has any mistakes in it, it will not run properly.
You can see in my animation here, I'm pressing the green flag to start my programme and nothing is happening.
My programme is not running.
We call mistakes in a programme errors.
Everybody who creates programmes makes errors.
Over time, you will get better at finding errors in programmes.
Aisha says, "Errors make you think about your programme." Let's do a little check here.
True or false? Errors are only made by beginners learning to programme.
Pause the video and have a think about what your answer might be.
Welcome back.
Well done for thinking about this question.
Let's see what the answer is.
True or false? Errors are only made by beginners learning to programme.
The answer is false.
Why? The answer is false because everybody who programmes makes errors.
Finding an error is a very important step.
When you know what the error is, you can start to fix it.
My animation showing that my programme is still not working.
Let's look more closely at this programme.
Can you see the mistake? What is the error? Pause this video and have a think about that.
The error is that there is no start block.
The programme will not run without a start block.
The solution is to add a start block.
We could add a start block to the beginning of this programme, just like that.
And then let's see if the programme runs.
There we go, happy penguin.
Let's look at another programme.
The giraffe is supposed to move next to the flower.
Hm, can you see the mistake? What is the error in this programme? Pause the video and have a think about that.
The error here is the value of the movement block.
The move right block should have a larger value.
That would help the giraffe reach the flower.
The solution is to change the value of the move right block.
So instead of it being at one, we're gonna change the value here on the keypad to 13.
And when we run the programme, the giraffe reaches the flower.
We found the solution.
Let's do a check here.
Watch this animation closely.
Oh, why does Tic not move next to the ball? I'm gonna say that question again.
Why does Tic not move next to the ball? Tic does not move next to the ball because A, the programme has no start Block, B, the wrong sprite has been programmed, C, the command blocks value is wrong.
Pause the video and see if you can come up with the correct answer.
Well done for working on your answers here.
The correct answer was B, the wrong sprite has been programmed.
That is why the ball sprite is moving instead of Tic.
Sprite does not have this programme on.
The programme at the bottom of the image is the programme for the ball.
So the wrong sprite has been programmed.
Well done if you got that right.
Lucas says, "Once I have noticed an error, what should I do next?" When you find an error in a programme, what could you do to fix it? Hm? Pause the video and have a think about that.
And if you've got someone near you, maybe you could share your ideas for what you could do to fix a programme once you find an error.
Well done for thinking about that question.
Let's move on.
These checking steps can help us find and fix errors in programmes.
One, understand the task.
Two, check the plan.
Three, test the programme.
Four, take one step at a time.
Let's look at these in more detail now.
Understand the task means that you should know what the idea behind the programme is.
Jacob says, "The programme is about a penguin exploring the South Pole." Check the plan means that you should look at the plan or the algorithm to check that your programme follows it.
Izzy says, "The algorithm looks like this." And we can see that there is an algorithm here that reads, "Start move five steps to the right, move five steps to the left, hop to the value of four, hop to the value of four, and end." Test the programme means running the programme to see what happens.
Aisha says, "Nothing happens when I test the programme." Oh, that could be a clue that something is missing or something is wrong in the programme.
Take one step at a time means you should be testing your programme every time you add something.
Lucas says, "The start block is missing.
That is the error!" We're going to watch a clip now to see how to find and fix an error in a programme.
Okay, the first step here is to understand the task.
So the task for this programme was to show my penguin exploring the Antarctic.
The second part is to check the plan.
So let's look at the algorithm here.
It reads, "Start, move to the right five, move to the left five, hop four, hop four, end." But when I run the programme, I'm testing it, nothing is happening.
So that means I'm likely forgetting a block.
So I'm going to look and see in my programme if I've missed any commands.
Ah, I've missed a command at the start.
I'm going to use the start block there.
And now when I test the programme, let's see how it looks.
Oh, that's a lot better.
This way my programme and my algorithm now match exactly.
So I have fixed my error in my programme.
Okay, we're gonna get ready to do a task now.
Part one of the tasks says, "In ScratchJr, add a butterfly sprite.
Choose the jungle background.
Move the sprite So it starts at the top of the waterfall." And you can see in my image here, I have done those steps.
I've got a butterfly sprite, I've got the jungle background, and I've moved it so that the butterfly is at the top of the waterfall.
Pause this video now to set your task up like this and then come back for the next steps.
Part two of this task says, "Copy this programme to make the butterfly land on the single mushroom on the right." So I want you to add this programme to the butterfly sprite and I want you to test it to check that the butterfly flies down six and then to the right four to make sure that it lands on the single mushroom on the right.
It's time to pause this video now, work on this part of the task, and I'll be here when you get back.
Welcome back.
Well done for all of your hard work.
Your butterfly should be following this programme now to make it land on the single mushroom on the right.
But let's see what's going to happen in step three.
Izzy says, "Oh no! I need the butterfly to land on the pair of mushrooms on the left, not the single mushroom on the right." Step three says, "Find and fix the arrows in your programme so that the butterfly lands on the pair of mushrooms instead." It's time for you to pause the video now and go and find and fix the errors in your programme to make it match what we need to do now.
We need to change the programme so the butterfly lands on the pair of mushrooms to the left.
Welcome back, well done for working on that task.
That was a tricky one.
So there are lots of different ways to do this task.
You could have a few different programmes on your butterfly, but this is how I did it.
I did the green flag, then I did move left nine, and then I did move down nine, and then the end block, and that result meant that my butterfly lands on a pair of mushrooms. Well done for all of your hard work in that task.
In the next part of the lesson, we will be creating and testing programmes.
Are you ready? Let's go.
Okay, let's start with a check here.
True or false? You should test your programme when it is finished.
Pause the video here and work on your answer to this question.
Welcome back.
True or false? You should test your programme when it is finished.
The answer is false.
Why? You should test your programme after every step.
This will help you spot errors.
Well done if you got that one right.
The show and hide blocks are in the pink looks category.
You can see here, I have marked the looks category for you, as well as the blocks for hide and show.
These command blocks let you decide whether a sprite is visible.
If a sprite is visible, it means it can be seen.
So when I run this programme, oh, you can see that Tic hides, he moves, and then he shows, just like that.
To make sure you don't get errors when you use show and hide, remember the checking steps.
One, understand the task.
Two, check the plan.
Three, test the programme.
Four, take one step at a time.
Understand the task means that you should know what the idea behind the programme is.
Aisha says, "The idea is that Tic is walking to a house and going inside it.
At the house, Tic will hide so they are not visible." Check the plan means that you should look at the plan or the algorithm to check that your programme follows it.
Lucas says, "The algorithm looks like this." So the algorithm is written with a start, and move to the right six, a hide, and then end.
Test the programme means running the programme to see what happens.
Jacob says, "When I test the programme, Tic moves but doesn't hide." And we can see that in the animation here.
When you reset and then run the programme, Tic moves to the right but doesn't hide.
Take one step at a time means you should be testing your programme every time you add something.
Izzy said, "I created the programme again one step at a time and found my error." I wonder if you have spotted the error in this programme.
Why doesn't Tic hide? Watch the animation closely, look at the programme, and look at the algorithm.
A, the wrong block is used.
B, the wrong value is used.
C, the wrong sprite is used.
Pause the video now and have a think about which answer is correct.
Well done for thinking about this question.
The correct answer is A, the wrong block is used.
So Tic doesn't hide because the block that's used in the programme is the wrong block.
The pink block shown is not the hide block, it is the show block.
So in this case, the wrong block is used.
So to fix this programme, we would take away that pink show block and swap it out for the hide block.
Well done if you got that right.
What is a celebration? A celebration is when people do something special to show that they are happy about something.
They might have a party, eat special food, play games, or spend time with family and friends.
This might be for a birthday or a big achievement.
Sometimes people go on holiday to have a celebration.
In ScratchJr today, you are going to be creating your own celebration animation.
If you spot an error in your programme, use the checking steps to fix it.
You can use any sprites and backgrounds for your animation.
Use any of these blocks or try some new ones out.
And as examples, I've given you here the show and hide block, the grow and shrink blocks, and the blue movement blocks, and the start and end blocks too.
It's time to pause the video now and work on your celebration animation.
Off you go and I'll be here when you get back.
Welcome back.
I loved seeing everybody's celebration animations.
I saw some birthdays, I saw some holidays, some awards.
It was really exciting to see what you were thinking about that word celebration.
We're going to watch a clip now to see how I created a celebration animation, all to do with Tic's birthday.
In this task, I'm going to show you how to create a celebration animation.
First step here is choosing a background.
I'm going to go and add some sprites in.
I'm going to go down to the bottom of the sprites menu and find the table.
Let's see if I can find it.
There it is.
I'm gonna add that in with Tic.
Gonna press the + again and go and find something you might see at a celebration.
It is the cake.
And add that in and move it down.
Great.
Okay, Tic needs some friends at the celebration, so I'm going to go and add Tac the sprite in with Tic, move Tac over there.
One more sprite.
Let's get chicken.
With Tic, add chicken in, move it to the side.
Okay, now let's put some command blocks on these characters.
So you need start flag for chicken.
I'm gonna think what I want chicken to do.
I'm gonna move chicken up to the top of the room so chicken can walk down using the move down value four.
Let's test that.
You can see I'm testing right here at the beginning.
I will be testing the whole way through this programme to check for any errors.
All right, chicken looks good.
Reset there.
Let's put some coding on Tac.
Move Tac to the side.
And then that way, I can use the move to the left block to give Tac some movement.
Let's test that.
Looking good.
What else do I need? So Tic needs some movement as well.
So I'm gonna get the green flag for the start block and then drag Tic up to the top of the room, similar to my idea for chicken, so that we can let Tic use the move down command with a value of four to walk up to the cake.
Now I'm thinking it would be really fun if my friends at the party were hiding and then they could show, like they're jumping out like it's a surprise party.
So I'm adding the hide and the show to Tac.
And the same with chicken, I'm adding the hide and then the show.
So hide, move down, show.
Let's run that.
Oh, I'm noticing an error here.
Tac is not in the right starting position, so I'm moving Tac over there.
The good thing I ran that programme to check.
Okay, Tac and chicken are doing the right movements.
But I'm thinking that Tic is sort of standing on the cake and I'm wondering how to fix that.
Maybe if I tap on the Tic sprite and change his movement value, that does look better.
If I tap on the cake and move it down a bit, it sort of goes on top of Tic, and it looks better that way.
So I've sort of solved that issue.
So I want Tac to do a hop and chicken to hop as well.
And then I'd like Tic to do a big spin.
I'm do turn to the left here.
And I've learned that 12 does a turn all the way around, just like that.
My programme is looking really good now.
I would like Tic to move down a bit more, and I'm wondering how to do that.
So I'm adding the, changing the value to make it a four again.
And I'm figuring out that I could drag the table further down and then drag the cake down to give Tic a bit more room.
Let me run that programme.
Oh, that looks really good now.
I think my programme is nearly finished.
I just need to add my end blocks onto the ends of my sprites here, and then my program's gonna be finished.
Let me run it one last time.
There we go.
Happy birthday, Tic.
In part two of this task, I want you to share your ideas about your celebration animation with a partner.
Use these words to help you.
Now there are some keywords in these word lists, so listen carefully for them, okay? Here we go.
We've got sprite, command block, test, undo, visible, animation, error, reset, and programme.
You can pause this video here and off you go to talk about your celebration animation with a partner.
Welcome back.
I'm sure you enjoyed sharing your ideas with your partner about your celebration animation.
Everybody would've spoke about different things, so this is just an example.
Let's see what Lucas said about his programme.
Lucas says, "I created a birthday celebration animation.
I used command blocks to create a programme for my sprite.
I tested my programme after every step.
My favourite part is when my sprite becomes visible and hops up and down." You have worked so hard today and learned a lot about finding and fixing errors in programmes.
Let me summarise what we've learned today.
An error is a mistake in a programme.
Over time, you will get better at spotting errors.
To make sure you don't get errors, use the checking steps, understand the task, check the plan, test the programme, and take one step at a time.
Errors can be spotted by testing your programme often.
The show and hide command blocks control if sprite is visible or not.
Thank you for coming to learn with me today.
I really enjoyed working with you, and I hope to see you again soon.