This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2012-01-12 17:40:21

santaho
New Scratcher
Registered: 2012-01-12
Posts: 1

Operators Help

I Really don't understand operators at all can someone help me understand them.

Offline

 

#2 2012-01-12 17:50:38

RedRocker227
Scratcher
Registered: 2011-10-26
Posts: 1000+

Re: Operators Help

I'm presuming you know what the top four mean. They're just addition, subtraction, multiplication and division.
The "Pick random () to ()" block basically does what it sounds like it should do. So, say you put the numbers 5 and 8 in, it would pick a random number between 5 and 8. This block is especially useful in chance games.
The >, < and = blocks are all booleans. The > reports true if the number on the left is bigger than the number on the right. The < reports true if the number on the right is the biggest. The = reports true if the numbers are equal.
The "and" boolean only reports true if both the booleans inside it are true. The "or" reports true if either one of the booleans inside it is true. The "not" reports true if the boolean inside it is false.
"Mod" is basically the remainder of a division. So, 12 mod 5 would equal 2, because when you divide 12 by 5, there's 2 left over.
"Abs" is short for "absolute value". This turns a negative number into it's positive equivalent, but if the number is positive, it will not change. Another way to describe it is "the distance from zero".
The "round" block rounds the number inside it to the nearest whole number. There is currently no way to round to numbers to anything other than the nearest whole number.


Why

Offline

 

#3 2012-01-12 18:20:23

Lucario621
Community Moderator
Registered: 2007-10-03
Posts: 1000+

Re: Operators Help

This article might help you  smile . From there, if you have a question on a specific block, just click on the block's name.


http://i.imgur.com/WBkM2QQ.png

Offline

 

Board footer