Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » I need help with the mod and round blocks
- enenbee
-
18 posts
I need help with the mod and round blocks
I know alot about scratch but what is the mod and round block for?
- solved
-
100+ posts
I need help with the mod and round blocks
The
The scratchblock
block is a new operation called ‘modulo’. You might know the principle from primary school: modulo is a operation to get the remainder of a division. For example 10 mod 3 is 1.
The scratchblock
does exactly was the name says: It rounds the inserted number
- enenbee
-
18 posts
I need help with the mod and round blocks
Theblock is a new operation called ‘modulo’. You might know the principle from primary school: modulo is a operation to get the remainder of a division. For example 10 mod 3 is 1.
The scratchblockdoes exactly was the name says: It rounds the inserted number
Thanks

- itzg
-
2 posts
I need help with the mod and round blocks
Another way to think of
Using the example @solved provided,
The cool thing about ‘mod’ for programming in general is that it forces any input number to be between 0 and one less than the modulo. Got a pile of numbers like 3, 12, 5, 6, 8, 13, 8 and want to pack them into the buckets 0, 1, 2? Then ‘mod 3’ will turn those into 0, 0, 2, 0, 2, 1, 2.
is that it's the “remainder operator”.
Using the example @solved provided,
9 is the closest number that can be divided by 3 perfectly, so the remainder is 1 (or 10 - 9).
The cool thing about ‘mod’ for programming in general is that it forces any input number to be between 0 and one less than the modulo. Got a pile of numbers like 3, 12, 5, 6, 8, 13, 8 and want to pack them into the buckets 0, 1, 2? Then ‘mod 3’ will turn those into 0, 0, 2, 0, 2, 1, 2.
- enenbee
-
18 posts
I need help with the mod and round blocks
Another way to think ofis that it's the “remainder operator”.
Using the example @solved provided,9 is the closest number that can be divided by 3 perfectly, so the remainder is 1 (or 10 - 9).
The cool thing about ‘mod’ for programming in general is that it forces any input number to be between 0 and one less than the modulo. Got a pile of numbers like 3, 12, 5, 6, 8, 13, 8 and want to pack them into the buckets 0, 1, 2? Then ‘mod 3’ will turn those into 0, 0, 2, 0, 2, 1, 2.
Ok itzg my dad thanks for helping me with the
- Teyla0
-
4 posts
I need help with the mod and round blocks
what can you use the
blocks for in scratch? because i know that the () mod () is where is were if you were to say
the answer would say true instead of false but i don't know what to do with this block like what to use it for
and i don't have any idea what
block does and i also know what the
does so say you have a negative number in there so like
than it would make that number 900 so make the number positive instead of negative just what would you use that for?
and with the
not only do i not know what the abs () of block does but all the options of that block
My browser / operating system: Windows NT 10.0, Chrome 91.0.4472.77, No Flash version detected

blocks for in scratch? because i know that the () mod () is where is were if you were to say
the answer would say true instead of false but i don't know what to do with this block like what to use it for
and i don't have any idea what
block does and i also know what the
does so say you have a negative number in there so like
than it would make that number 900 so make the number positive instead of negative just what would you use that for?
and with the
not only do i not know what the abs () of block does but all the options of that block
My browser / operating system: Windows NT 10.0, Chrome 91.0.4472.77, No Flash version detected
- Teyla0
-
4 posts
I need help with the mod and round blocks
ok now its good but the i just don't know what any of those blocks would be used for because like the () mod () block just divides so like the only thing you could use it for would be like a calculator project because you could say like create a new sprite name it calculator and then say
- samq64
-
1000+ posts
I need help with the mod and round blocks
To clear things up, here are the Scratch wiki articles:
- Discussion Forums
- » Help with Scripts
-
» I need help with the mod and round blocks