If you put in (9 + 1) the operator will give you 10.
Variables are mostly used for calculator projects like mine. (link to project)
Offline
I think that by using operators you refer to simply having a script perform a mathematical calculation, and not necessarily making a project that acts as a calculator, right?
Scratch uses operator blocks that you give arguments, which then return your result. These (or any other "reporter" blocks) can be stacked inside of each other to make more complex expressions. The Scratch wiki has a more in-depth explanation on these and other blocks in the "operators" category here.
Offline
Harakou wrote:
I think that by using operators you refer to simply having a script perform a mathematical calculation, and not necessarily making a project that acts as a calculator, right?
Scratch uses operator blocks that you give arguments, which then return your result. These (or any other "reporter" blocks) can be stacked inside of each other to make more complex expressions. The Scratch wiki has a more in-depth explanation on these and other blocks in the "operators" category
Thats right.
For example in Python we can can just write the code:
>>> print 5 + 3
8
And the answer 8 is given.
What is the simplest way of doing this in Scratch?
Thanks for your help.
Offline
ashfm wrote:
Harakou wrote:
I think that by using operators you refer to simply having a script perform a mathematical calculation, and not necessarily making a project that acts as a calculator, right?
Scratch uses operator blocks that you give arguments, which then return your result. These (or any other "reporter" blocks) can be stacked inside of each other to make more complex expressions. The Scratch wiki has a more in-depth explanation on these and other blocks in the "operators" categoryThats right.
For example in Python we can can just write the code:
>>> print 5 + 3
8
And the answer 8 is given.
What is the simplest way of doing this in Scratch?
Thanks for your help.
Does print mean to say it?
Offline
laptop97 wrote:
ashfm wrote:
Harakou wrote:
I think that by using operators you refer to simply having a script perform a mathematical calculation, and not necessarily making a project that acts as a calculator, right?
Scratch uses operator blocks that you give arguments, which then return your result. These (or any other "reporter" blocks) can be stacked inside of each other to make more complex expressions. The Scratch wiki has a more in-depth explanation on these and other blocks in the "operators" categoryThats right.
For example in Python we can can just write the code:
>>> print 5 + 3
8
And the answer 8 is given.
What is the simplest way of doing this in Scratch?
Thanks for your help.Does print mean to say it?
Yes it does - the answer is displayed on the screen.
Offline
Your welcome. If you have any more questions you can ask on the forums or see if you can find it in the Scratch Wiki
Offline
ashfm wrote:
Harakou wrote:
I think that by using operators you refer to simply having a script perform a mathematical calculation, and not necessarily making a project that acts as a calculator, right?
Scratch uses operator blocks that you give arguments, which then return your result. These (or any other "reporter" blocks) can be stacked inside of each other to make more complex expressions. The Scratch wiki has a more in-depth explanation on these and other blocks in the "operators" categoryThats right.
For example in Python we can can just write the code:
>>> print 5 + 3
8[/blocks]
And the answer 8 is given.
What is the simplest way of doing this in Scratch?
Thanks for your help.
I think laptop97 already cleared this up, but I'll answer just in case.
You don't necessarily have to use variables, but if you have two constants like that it would be a bit superfluous to do it that way. I'm sure that's just for an example though?
Regardless, I think this is what you're looking for:
Offline
ashfm wrote:
laptop97 wrote:
Ok, then it would be
Say(X+Y) for (Z) secs
X, Y and Z are numbers you would put inSo I would have to use variables, right? Where X, Y and Z are variables.
I cannot just do a simple calculation like 3 + 3.
You can do this. Make 3 variables any thing you like (but be specific to avoid confusion) Set 1 variable to the amount of seconds you want. Set the other two for the two addends you want. Then put in a say block from Looks and put in an operators block (+) and put in the two addends (the two variables) in the plus block and put the variable for amount of seconds you want in the place where you can type in the amount of seconds you want. That should answer your problem.
Offline
those are used for calculators, so if you use (( <+> )) (( <-> )) (( <*> )) or (( </> )) something that has to do with the awnser happens so like if you use <turn cw( )degrees> [/blocks] so then if you put like (( <+> )) in there ill turn the awnser but you can also put things such as <mouse y> , <x position> , <size> and stuff in the ()s
Offline