Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » Operators
- Falvax
-
7 posts
Operators
Hey I really need help with operators I don't know how to use operators if you could make a tutorial or tell me in the comment I would be so happy here are the things I don't know when do I use them which one do I use addition subtraction divide or multiplication and how do i combine them and when do I combine them thanks
- codeywhizz
-
100+ posts
Operators
So you want to use urs operators how you do in the real world, like say you want to compute if u have 7 apples and ate 3 it would be
Notice how these are all calculations you do in real life, except they are shown in block symbols.
When combining 2, it does not follow BODMAS or PEDMAS which you are taught it school but you have to tell what order to do it in. It will work from the inside out so…
But:
The operators are:
+ for addition
- for subtraction
* for multiplication
/ for division
% for modulo (you can ignore this for now if you dont know this)
Let me know if you have questions
or if there are 5 boys with 4 cookies it is just
as multiplication is written as a *
Notice how these are all calculations you do in real life, except they are shown in block symbols.
When combining 2, it does not follow BODMAS or PEDMAS which you are taught it school but you have to tell what order to do it in. It will work from the inside out so…
would give 14 as the 4*3 which is 12 is on the inside, and then gets added to the 2
But:
will output 20 as the 3+2 is on the inside, which is 5, and then it multiplies to get 20
The operators are:
+ for addition
- for subtraction
* for multiplication
/ for division
% for modulo (you can ignore this for now if you dont know this)
Let me know if you have questions
- Falvax
-
7 posts
Operators
Ok here is my question when do I combine them and which ones do I combine like subtraction and division etc?
- codeywhizz
-
100+ posts
Operators
For whatever task you want to combine them, there is no specific moment where I tell you to use them, you use them literally for calculating, its like a calculator, you only click the add button when u want to add 2 numbers Ok here is my question when do I combine them and which ones do I combine like subtraction and division etc?
- EpicGhoul993
-
1000+ posts
Operators
Other way to think about this: All operator blocks (and just all blocks in general) also have (visible?) brackets around them. For each block, the bracket is its border. When combining 2, it does not follow BODMAS or PEDMAS which you are taught it school but you have to tell what order to do it in.
For example:
Most projects require operator blocks to calculate variables! Generally just use them however you see fit. when do I use them
For (yet another) example, here's a script I came up with to solve someone else's problem about number abbreviations. I recolored all blocks that are not operators (and also the purple blocks because this forum hates me /j) to grey for demonstration.
- Discussion Forums
- » Help with Scripts
-
» Operators