 Hello world, it's the surfing scratcher here bringing you another video connecting the world of maths to scratch You haven't already checked the description below for links to previous videos as this one is part of series In this video, we're gonna be hatching a plan to start the process of fixing our game And this is all about figuring out the number of images we need to move our balloons when we're dealt with result So let's get stuck in the wood Okay, so I've got a screenshot of the part in the game where we've got this call out That tells us what we need to do So it says we need to code the custom block calculate num integer to move In the cards sprite to get the balloon moving to the right spot Okay, so what I'll do now is I'm just going to uh go back across to the scratch project And let's just go find the card sprite and go find the custom block num integer to move So I'm back now on the scratch project and as you can see, I've just skipped through Here are all of our sprites and if I scroll through them, I can see one here that says cards And if I have a look and zoom out So then I can see all my code blocks here. I've got many custom blocks You can you should have an explorer of that in your own time But right now we can see that we've got this Custom block down here called calculate num integer to move And there is that save block need to code the custom block Calculate num integer move in the card sprite to get the balloon moving to the right spot Great, so we're going to now get rid of that code and I would like to use this video To plan for what we need to do before we actually get into the coding So I'm going to jump across to our plan and let's go through it Okay, so here we are in our scratch project planner for num integer to move And you'll see that we've got our stage here. We've got our sprites, our selected sprite and our variables of what we know So let's just go through our variables right now Here is the operation variable that we have access to and I can either be positive or sorry, addition or subtraction We've also got another variable called integer and this is an integer between the range of actually it's not negative 20 It's negative 10 and Positive 10. Okay, so that's the range the reason um, it's positive 10 is because We are now instructions that this is what the integer This is the integer variable and that can either be negative 10 or positive 10 great So then we've got this num integer to move which is used to store the combination so the combination of the result operation, which is this one And integer, which is this one Okay, so the result of these two To use later. Okay, so we're going to be using that later. Cool. So that's a big one We've got a calculation of these two or we've got to figure out Um, how many it needs you to move base of what our result of these two Variables are we've also got a custom block calculating on integer move Well, we know that's where we're going to put all of our custom code So what I'm going to do now is just hide this explanation. Just so we've got some space for our scripts So what we have is we've got an example here. So at the moment our operation variable would be subtraction Okay, so subtraction and currently our integer is positive 8. Okay, so positive 8 So that's All right. Now we know the combination of those two the result would be To move play one's balloon to negative eight because when we take away positives we go down Okay, so we know that we need to end up here at negative eight Great. So it's just nice to have a real world example here so when I'm trying to Think of all the possible scenarios, I'm going to start with Uh, probably my operation first and then I'm going to jump into my integer So there's only two possibilities for our operations either subtraction or addition And there's uh, 21 different possibilities. So there's negative 10 to 1 There's 1 to 10 and there's also 0 for integers. So there's 21 possibilities. Okay So I'll start with the small one first and then we can branch that one out So I've got a couple of uh pre-made english sentences that I've made already and I'm going to fill in the blanks I'm just going to show the first one to you now. Okay. So I've got our first english sentence here And it's sort of a fill-in-the-gap activity. Uh, and let's see if we can use it to help us with our understanding here So it says if the variable operation. Well, that's this one here is the Sign, okay, so we know that it's not going to be the integer and numbers It can only be the operation which is a subtraction sign or an addition sign So I like to start with positive things first So if the operation is the positive sign, okay, you could write the word positive. Mine's been a bit laggy We'll probably put the sign in there if the operation is the positive sign, then we need to do something Or what do we need to do? Well, we're gonna set the variable To the variable Okay, so remember that we need to use a combination of the operation and the integer to Uh, get to our number of integers to move. So Ultimately we want to set the number The num integers to move so the num is I'm just going to abbreviate that so the num is the integers to move to the variable Well, this is what we've got to use here. Would we set number of integers to move to negative? Or sorry subtraction, probably not. Would we set it to positive? Probably not Would we set it to positive eight? Okay, well, we if if The operation were positive. So if this were positive We would just want to set our integer to positive to eight or the num integers to move to eight because that's the result We've got we'd be adding eight and all we need then is just the integer So we just need to set the number of integers to move when the operation is positive to integer Okay, very straightforward. So what that says is whenever the operation is positive Just set the number of integers to move to the integer as it is like really simple that one Like we don't have to do much work, which is awesome Let's go check out for the other scenario Okay, so we've got our next piece of code here. So this is for the If the operation isn't a positive sign well if operation if the variable operation and I'm just going to write operation here if the operation is the Sign the subtraction sign Then we want we need to do something else Then we need to set the variable. Well, we need to set the same variable. So that's going to be your number All we need just to move and again, I'm just going to abbreviate that to zero minus the variable So zero, so I'm just going to write that zero minus Some variable. Okay, so Let's take this scenario that we've got right now. So if we set the variable number of integers to move to zero minus the variable integer. So I'm just going to write integer just to See that because we wouldn't set it to the operation because we don't need to set number of integers to move to be an operation In this particular scenario, we'd be setting the number of integers to move to zero minus eight Okay, so that would then If we were to go zero minus eight that would equal negative eight Okay And that's exactly the result that we have here We need to take away a positive number and when we take away a positive number We need to take away eight, which is what we're doing exactly here um So that would be negative eight and then what we could do later is we would take that number and we would add it On to where our current balloon is so the current balloon is zero And then we would take away that eight to end up at our negative eight so that is Basically the logic that we're going to be using and it's not totally basic But yeah, that is the logic that we're going to be using to figure out Where our balloons need to be and I encourage you to pause the video and try this out with a few different Operations just to see how it works like have a couple of addition signs in here with the negative numbers and just see the results of this logic That's all for this video in the next one. We're going to take our plan and translate it into scratch blocks If you like this video, give it a thumbs up and if you want to stay connected to when I release more content Make sure you hit that subscribe button, but until then i'm off to go find the wave. Take it easy