 They're for all those green boolean and reporter blocks, but just how do you use those operators in scratch? We'll stick around because in this scratch operators tutorial. I'll walk you through the basics including the mod operator come on up Hello world serving scratchy here teacher separate programmer bringing you the goodness of learning to code through video tutorials If it sounds like something that you're into then consider hitting that subscribe button Hey, I've had a few people ask me about my funky teas if you're into them as much as I am then hit the description below Where you can find a link to this tea and if you purchase it it will support this channel But hey, let's start operating on those blocks right here. I am in the green operators category You'll notice that an operator block can either be a reporter block or a boolean block. Let's go explore them from the top Here I've dragged out the top four blocks and these four blocks refer to the basic four operations in mathematics top We have addition subtraction multiplication and division expecting that you have some understanding of maths So one plus two is three two take away one is one two times three is six and six split into two Equal groups will be three these can also be decimals and Negative numbers care the next block that we can explore is this pick random number So you're asked to input a range from a start number to an end number This current statement will speak around on between one and ten including these two numbers All right, so if I click this it gives us three if I click it again It's given us to we can also input decimals into this one as well So pick around a number from one tenth to ten given us the number 5.50 You can also input negative numbers into here. Okay, I've got these emojis on the screen to help us with our next blocks Here's my left hand and here is my right hand and courage you to make these signs with your hands right now You turn your hands. So they're pointing towards each other like this then you'll remember less than and greater than. So your left hand starting with L means the less than symbol. If you can remember that, then you'll be able to remember the greater than symbol is just your right hand. Just remember the L's match up. Now that we know that, let's drag out our first block. Is this a less than block or a greater than block? Or check out the hands, it's a greater than block. And just to show that, if I put 51 in here, 51 is greater than 50. If I click this, it'll say true. If I enter 50, then it will not be true because 50 is not greater than 50. 50 is equal to 50. To help us understand these Boolean blocks a little bit more, I've got this Boolean sign up here and this code to help us out. When this condition is true, we're going to see a green light on our sign here. When this condition is false, we will see the red light. We know this condition is false. So if I stick it into here, it should still be false. But I'll make this statement now true and we're in the green. Let's test out some of these other green Boolean operator blocks. Okay, our next one is the less than sign. So zero or nothing is currently less than 50. Just to highlight that, there is zero. If I change this number to 50, again, 50 is not less than 50. 50 is equal to 50. But if I make this 49, then we are green. All right, our next one, if one number is equal to another, so the only way this will be true is if the number 50 is entered into here. It's important to know that this block isn't reserved just for numbers. This is also for text. So is yes equal to 50? No, yes is equal to yes. Now this is really handy if you've got variables. Say I've got the two variables yes and no. Is yes equal to yes? Yes, is no equal to yes? No, but no is equal to no. Confused. Remember, this variable is now holding the text no. So if I drag this out and just write the word no, no is equal to no. So if I've been testing a single condition, if it is true, the next blocks allow us to test multiple conditions. Let's create two true statements. So 50 is equal to 50, if I press this, that is true. And let's duplicate it. And let's go yes is equal to yes, which is also true. So what this is saying, if this condition is true and a second condition is true, then this whole thing has to be true. So if I make this equal to no, now this boolean block is false. This boolean block is true. But the whole block together is false. If I drag this in, you'll see that by the red light here. But if I change this second input field to yes, boom. We're back to green. The next boolean operator block is the all block. And what this block means is that only one of these conditions needs to be true. So we know that 50 is equal to 50. And we know that yes is equal to yes. Now they're both true. So this will be true, of course. If I change yes to no, we know that that is no longer true if I click it, it's false, all right? But I drag it in there and I click the whole block together. It is true because this condition here is true. Now, if I change one of these numbers to say 49, now both of these conditions are false. If I click this, this whole condition is false. Let's drag it in, have a little look see at that. Gonna change 49 back to 50 and we should get a green light and we do. There's a chance this next block may confuse you. And it is a not block. And a not block is checking for a false condition. And if there's a false condition in here, then this block will evaluate to true. The best way to demonstrate this is to use a sensing block. So we're gonna sense touching the edge. Is the Boolean sign touching the edge? Well, no, it's not, it's false, okay? So if the Boolean sign is not touching the edge, then this should be true and it is, okay? Now, if I drag this block into here, you'll see that it is true, right? Because the sign is not touching the edge of the screen. If I go ahead and drag this sign now and drop it, and you'll see it is valued false. Now, if I drag this sign back interview, we're true again, back and false. We've got some reporter blocks to cover right now. The first is this join block. What this does is it joins two text values together. So if I click this, it will say Apple Banana. Notice there's a space there. I'm gonna go ahead and type surfing, scratcher. Gonna click it, you'll notice there's no gap or there's no space between surfing and scratchers. So just remember that you need to put that space in for that to happen. You can also get multiple join statements and join them up. So this will now say Apple Banana Scratcher. Okay, that's quite funny. The next reporter block checks to see which letter is at a current location. So this is getting the first letter of the word Apple. I'd expect this to say A. You get the second letter of the word Apple and that would be a P. The last letter of the word Apple would be an A. You can also get the length of a word. So there are five letters in the word Apple. You can also get one of these and stick them inside. So you get the letter, the length, the last letter of the word Apple, which is E, we just did that. We can also use a Boolean block to check to see if a word or a number contains a particular value. So does Apple contain the letter A? Yes, it does. Does it contain the number three? Nope. Okay, this is a mod reporter block. And this is a little bit like division. Well, if you know division, then you'll know your mods. If you've ever done division before and you've had that remainder, well, that's basically what a mod does. It just gets the remainder value. You take the number 10 and you could split that into five equal groups and there would be two in each of those equal groups. So there'd be no remainder. But if you wanted to split that into equal groups of four, you'd only get two equal groups and there would be two left over. Mods are really handy to work out odd and even numbers. If you divide any number by two, if the mod is equal to zero, then you know that's an even number. But if we make this an odd number now, you know that if you divide this by two, there's always going to be one left over. Very handy for odd and even numbers. All right, let's drag out this round block. This block just rounds the number to the nearest integer. So say I've got 12.1, that will round it down to 12. If I've got 12.5, then that will round it up to 13. So it just follows the normal rounding rules. This next block's a little bit gnarly and we're not going to cover it in detail. It's going to click open this dropdown menu and there's a whole heap of options. Now, a lot of these relate to a little bit more advanced masks that we'll cover in future videos. I just want to share a couple of them in here. So this ABS stands for absolute value and what that does is it kind of strips a negative number of its negativeness. So negative 14 would just become 14. The next one I want to go through is floor. Now floor is very, very similar to our round here, but instead of rounding it up or down, it always rounds it down towards the floor. That's how I remember this one. So 12.5 would be rounded to 12. If you always wanted to round up to the nearest integer, you would round to the ceiling. So 12.5 would be rounded up to 13, but even 12.1 would be. I'll leave a link to this project in the description if you'd like to use this Boolean sign and this code to check out some of your operator blocks. All right, it's time for a scratchy question and I want to know if you're still a little bit fuzzy on operating scratch. No worries if you are, drop a comment in the section below and we'll get it sorted. Hey, thanks for checking out this scratch for the operator's tutorial. Like, subscribe, ring that bell if you're new and have a scout of some of the other content on your screen right now. You can show your support for Surfing Scratcher by becoming a member of my Patreon page on the link below or go have a size out of some of these tees. But until then, I'm off to go find a way. I'll catch you in the next one.