Discuss Scratch

enenbee
Scratcher
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
Scratcher
100+ posts

I need help with the mod and round blocks

The
mod0
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
round
does exactly was the name says: It rounds the inserted number
enenbee
Scratcher
18 posts

I need help with the mod and round blocks

solved wrote:

The
mod0
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
round
does exactly was the name says: It rounds the inserted number

Thanks
itzg
Scratcher
2 posts

I need help with the mod and round blocks

Another way to think of
mod0
is that it's the “remainder operator”.

Using the example @solved provided,
10mod3
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
Scratcher
18 posts

I need help with the mod and round blocks

itzg wrote:

Another way to think of
mod0
is that it's the “remainder operator”.

Using the example @solved provided,
10mod3
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
andmod0blocksround
Teyla0
Scratcher
4 posts

I need help with the mod and round blocks

what can you use the

mod

round

of

blocks for in scratch? because i know that the () mod () is where is were if you were to say

15mod5=3

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
absof

block does and i also know what the
round

does so say you have a negative number in there so like
round-900

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
of9

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
Scratcher
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
oknowitsgoodbuttheijustdon'tknowwhatanyofthoseblockswouldbeusedforbecauselikethemodblockjustdividessoliketheonlythingyoucoulduseitforwouldbelikeacalculatorprojectbecauseyoucouldsaylikecreateanewspritenameitcalculatorandthensayscratchblocksoknowitsgoodbuttheijustdon'tknowwhatanyofthoseblockswouldbeusedforbecauselikethemodblockjustdividessoliketheonlythingyoucoulduseitforwouldbelikeacalculatorprojectbecauseyoucouldsaylikecreateanewspritenameitcalculatorandthensayscratchblocksoknowitsgoodbuttheijustdon'tknowwhatanyofthoseblockswouldbeusedforbecauselikethemodblockjustdividessoliketheonlythingyoucoulduseitforwouldbelikeacalculatorprojectbecauseyoucouldsaylikecreateanewspritenameitcalculatorandthensayscratchblocksoknowitsgoodbuttheijustdon'tknowwhatanyofthoseblockswouldbeusedforbecauselikethemodblockjustdividessoliketheonlythingyoucoulduseitforwouldbelikeacalculatorprojectbecauseyoucouldsaylikecreateanewspritenameitcalculatorandthensayscratchblocksoknowitsgoodbuttheijustdon'tknowwhatanyofthoseblockswouldbeusedforbecauselikethemodblockjustdividessoliketheonlythingyoucoulduseitforwouldbelikeacalculatorprojectbecauseyoucouldsaylikecreateanewspritenameitcalculatorandthensayscratchblocksoknowitsgoodbuttheijustdon'tknowwhatanyofthoseblockswouldbeusedforbecauselikethemodblockjustdividessoliketheonlythingyoucoulduseitforwouldbelikeacalculatorprojectbecauseyoucouldsaylikecreateanewspritenameitcalculatorandthensayscratchblocksoknowitsgoodbuttheijustdon'tknowwhatanyofthoseblockswouldbeusedforbecauselikethemodblockjustdividessoliketheonlythingyoucoulduseitforwouldbelikeacalculatorprojectbecauseyoucouldsaylikecreateanewspritenameitcalculatorandthensayscratchblocksoknowitsgoodbuttheijustdon'tknowwhatanyofthoseblockswouldbeusedforbecauselikethemodblockjustdividessoliketheonlythingyoucoulduseitforwouldbelikeacalculatorprojectbecauseyoucouldsaylikecreateanewspritenameitcalculatorandthensayscratchblocksoknowitsgoodbuttheijustdon'tknowwhatanyofthoseblockswouldbeusedforbecauselikethemodblockjustdividessoliketheonlythingyoucoulduseitforwouldbelikeacalculatorprojectbecauseyoucouldsaylikecreateanewspritenameitcalculatorandthensayscratchblocksoknowitsgoodbuttheijustdon'tknowwhatanyofthoseblockswouldbeusedforbecauselikethemodblockjustdividessoliketheonlythingyoucoulduseitforwouldbelikeacalculatorprojectbecauseyoucouldsaylikecreateanewspritenameitcalculatorandthensayscratchblocksoknowitsgoodbuttheijustdon'tknowwhatanyofthoseblockswouldbeusedforbecauselikethemodblockjustdividessoliketheonlythingyoucoulduseitforwouldbelikeacalculatorprojectbecauseyoucouldsaylikecreateanewspritenameitcalculatorandthensayscratchblocksoknowitsgoodbuttheijustdon'tknowwhatanyofthoseblockswouldbeusedforbecauselikethemodblockjustdividessoliketheonlythingyoucoulduseitforwouldbelikeacalculatorprojectbecauseyoucouldsaylikecreateanewspritenameitcalculatorandthensayscratchblocksoknowitsgoodbuttheijustdon'tknowwhatanyofthoseblockswouldbeusedforbecauselikethemodblockjustdividessoliketheonlythingyoucoulduseitforwouldbelikeacalculatorprojectbecauseyoucouldsaylikecreateanewspritenameitcalculatorandthensayscratchblocksoknowitsgoodbuttheijustdon'tknowwhatanyofthoseblockswouldbeusedforbecauselikethemodblockjustdividessoliketheonlythingyoucoulduseitforwouldbelikeacalculatorprojectbecauseyoucouldsaylikecreateanewspritenameitcalculatorandthensayscratchblocksoknowitsgoodbuttheijustdon'tknowwhatanyofthoseblockswouldbeusedforbecauselikethemodblockjustdividessoliketheonlythingyoucoulduseitforwouldbelikeacalculatorprojectbecauseyoucouldsaylikecreateanewspritenameitcalculatorandthensayscratchblocksoknowitsgoodbuttheijustdon'tknowwhatanyofthoseblockswouldbeusedforbecauselikethemodblockjustdividessoliketheonlythingyoucoulduseitforwouldbelikeacalculatorprojectbecauseyoucouldsaylikecreateanewspritenameitcalculatorandthensayscratchblocksoknowitsgoodbuttheijustdon'tknowwhatanyofthoseblockswouldbeusedforbecauselikethemodblockjustdividessoliketheonlythingyoucoulduseitforwouldbelikeacalculatorprojectbecauseyoucouldsaylikecreateanewspritenameitcalculatorandthensayscratchblocksoknowitsgoodbuttheijustdon'tknowwhatanyofthoseblockswouldbeusedforbecauselikethemodblockjustdividessoliketheonlythingyoucoulduseitforwouldbelikeacalculatorprojectbecauseyoucouldsaylikecreateanewspritenameitcalculatorandthensayscratchblocksoknowitsgoodbuttheijustdon'tknowwhatanyofthoseblockswouldbeusedforbecauselikethemodblockjustdividessoliketheonlythingyoucoulduseitforwouldbelikeacalculatorprojectbecauseyoucouldsaylikecreateanewspritenameitcalculatorandthensayscratchblocksoknowitsgoodbuttheijustdon'tknowwhatanyofthoseblockswouldbeusedforbecauselikethemodblockjustdividessoliketheonlythingyoucoulduseitforwouldbelikeacalculatorprojectbecauseyoucouldsaylikecreateanewspritenameitcalculatorandthensayscratchblocksoknowitsgoodbuttheijustdon'tknowwhatanyofthoseblockswouldbeusedforbecauselikethemodblockjustdividessoliketheonlythingyoucoulduseitforwouldbelikeacalculatorprojectbecauseyoucouldsaylikecreateanewspritenameitcalculatorandthensayscratchblocksoknowitsgoodbuttheijustdon'tknowwhatanyofthoseblockswouldbeusedforbecauselikethemodblockjustdividessoliketheonlythingyoucoulduseitforwouldbelikeacalculatorprojectbecauseyoucouldsaylikecreateanewspritenameitcalculatorandthensayscratchblocksoknowitsgoodbuttheijustdon'tknowwhatanyofthoseblockswouldbeusedforbecauselikethemodblockjustdividessoliketheonlythingyoucoulduseitforwouldbelikeacalculatorprojectbecauseyoucouldsaylikecreateanewspritenameitcalculatorandthensayscratchblocksoknowitsgoodbuttheijustdon'tknowwhatanyofthoseblockswouldbeusedforbecauselikethemodblockjustdividessoliketheonlythingyoucoulduseitforwouldbelikeacalculatorprojectbecauseyoucouldsaylikecreateanewspritenameitcalculatorandthensayscratchblocksoknowitsgoodbuttheijustdon'tknowwhatanyofthoseblockswouldbeusedforbecauselikethemodblockjustdividessoliketheonlythingyoucoulduseitforwouldbelikeacalculatorprojectbecauseyoucouldsaylikecreateanewspritenameitcalculatorandthensayscratchblocksoknowitsgoodbuttheijustdon'tknowwhatanyofthoseblockswouldbeusedforbecauselikethemodblockjustdividessoliketheonlythingyoucoulduseitforwouldbelikeacalculatorprojectbecauseyoucouldsaylikecreateanewspritenameitcalculatorandthensayscratchblocksoknowitsgoodbuttheijustdon'tknowwhatanyofthoseblockswouldbeusedforbecauselikethemodblockjustdividessoliketheonlythingyoucoulduseitforwouldbelikeacalculatorprojectbecauseyoucouldsaylikecreateanewspritenameitcalculatorandthensayscratchblocksoknowitsgoodbuttheijustdon'tknowwhatanyofthoseblockswouldbeusedforbecauselikethemodblockjustdividessoliketheonlythingyoucoulduseitforwouldbelikeacalculatorprojectbecauseyoucouldsaylikecreateanewspritenameitcalculatorandthensayscratchblocksoknowitsgoodbuttheijustdon'tknowwhatanyofthoseblockswouldbeusedforbecauselikethemodblockjustdividessoliketheonlythingyoucoulduseitforwouldbelikeacalculatorprojectbecauseyoucouldsaylikecreateanewspritenameitcalculatorandthensayscratchblocksoknowitsgoodbuttheijustdon'tknowwhatanyofthoseblockswouldbeusedforbecauselikethemodblockjustdividessoliketheonlythingyoucoulduseitforwouldbelikeacalculatorprojectbecauseyoucouldsaylikecreateanewspritenameitcalculatorandthensayscratchblocksoknowitsgoodbuttheijustdon'tknowwhatanyofthoseblockswouldbeusedforbecauselikethemodblockjustdividessoliketheonlythingyoucoulduseitforwouldbelikeacalculatorprojectbecauseyoucouldsaylikecreateanewspritenameitcalculatorandthensayscratchblocksoknowitsgoodbuttheijustdon'tknowwhatanyofthoseblockswouldbeusedforbecauselikethemodblockjustdividessoliketheonlythingyoucoulduseitforwouldbelikeacalculatorprojectbecauseyoucouldsaylikecreateanewspritenameitcalculatorandthensayscratchblocksoknowitsgoodbuttheijustdon'tknowwhatanyofthoseblockswouldbeusedforbecauselikethemodblockjustdividessoliketheonlythingyoucoulduseitforwouldbelikeacalculatorprojectbecauseyoucouldsaylikecreateanewspritenameitcalculatorandthensayscratchblocksoknowitsgoodbuttheijustdon'tknowwhatanyofthoseblockswouldbeusedforbecauselikethemodblockjustdividessoliketheonlythingyoucoulduseitforwouldbelikeacalculatorprojectbecauseyoucouldsaylikecreateanewspritenameitcalculatorandthensayscratchblocksoknowitsgoodbuttheijustdon'tknowwhatanyofthoseblockswouldbeusedforbecauselikethemodblockjustdividessoliketheonlythingyoucoulduseitforwouldbelikeacalculatorprojectbecauseyoucouldsaylikecreateanewspritenameitcalculatorandthensayscratchblocksoknowitsgoodbuttheijustdon'tknowwhatanyofthoseblockswouldbeusedforbecauselikethemodblockjustdividessoliketheonlythingyoucoulduseitforwouldbelikeacalculatorprojectbecauseyoucouldsaylikecreateanewspritenameitcalculatorandthensayscratchblocksoknowitsgoodbuttheijustdon'tknowwhatanyofthoseblockswouldbeusedforbecauselikethemodblockjustdividessoliketheonlythingyoucoulduseitforwouldbelikeacalculatorprojectbecauseyoucouldsaylikecreateanewspritenameitcalculatorandthensayscratchblocksoknowitsgoodbuttheijustdon'tknowwhatanyofthoseblockswouldbeusedforbecauselikethemodblockjustdividessoliketheonlythingyoucoulduseitforwouldbelikeacalculatorprojectbecauseyoucouldsaylikecreateanewspritenameitcalculatorandthensayscratchblocksoknowitsgoodbuttheijustdon'tknowwhatanyofthoseblockswouldbeusedforbecauselikethemodblockjustdividessoliketheonlythingyoucoulduseitforwouldbelikeacalculatorprojectbecauseyoucouldsaylikecreateanewspritenameitcalculatorandthensayscratchblocksoknowitsgoodbuttheijustdon'tknowwhatanyofthoseblockswouldbeusedforbecauselikethemodblockjustdividessoliketheonlythingyoucoulduseitforwouldbelikeacalculatorprojectbecauseyoucouldsaylikecreateanewspritenameitcalculatorandthensayscratchblocksoknowitsgoodbuttheijustdon'tknowwhatanyofthoseblockswouldbeusedforbecauselikethemodblockjustdividessoliketheonlythingyoucoulduseitforwouldbelikeacalculatorprojectbecauseyoucouldsaylikecreateanewspritenameitcalculatorandthensayscratchblocksoknowitsgoodbuttheijustdon'tknowwhatanyofthoseblockswouldbeusedforbecauselikethemodblockjustdividessoliketheonlythingyoucoulduseitforwouldbelikeacalculatorprojectbecauseyoucouldsaylikecreateanewspritenameitcalculatorandthensayscratchblocksoknowitsgoodbuttheijustdon'tknowwhatanyofthoseblockswouldbeusedforbecauselikethemodblockjustdividessoliketheonlythingyoucoulduseitforwouldbelikeacalculatorprojectbecauseyoucouldsaylikecreateanewspritenameitcalculatorandthensayscratchblocksoknowitsgoodbuttheijustdon'tknowwhatanyofthoseblockswouldbeusedforbecauselikethemodblockjustdividessoliketheonlythingyoucoulduseitforwouldbelikeacalculatorprojectbecauseyoucouldsaylikecreateanewspritenameitcalculatorandthensayscratchblocksoknowitsgoodbuttheijustdon'tknowwhatanyofthoseblockswouldbeusedforbecauselikethemodblockjustdividessoliketheonlythingyoucoulduseitforwouldbelikeacalculatorprojectbecauseyoucouldsaylikecreateanewspritenameitcalculatorandthensayscratchblocksoknowitsgoodbuttheijustdon'tknowwhatanyofthoseblockswouldbeusedforbecauselikethemodblockjustdividessoliketheonlythingyoucoulduseitforwouldbelikeacalculatorprojectbecauseyoucouldsaylikecreateanewspritenameitcalculatorandthensayscratchblocksoknowitsgoodbuttheijustdon'tknowwhatanyofthoseblockswouldbeusedforbecauselikethemodblockjustdividessoliketheonlythingyoucoulduseitforwouldbelikeacalculatorprojectbecauseyoucouldsaylikecreateanewspritenameitcalculatorandthensayscratchblocksoknowitsgoodbuttheijustdon'tknowwhatanyofthoseblockswouldbeusedforbecauselikethemodblockjustdividessoliketheonlythingyoucoulduseitforwouldbelikeacalculatorprojectbecauseyoucouldsaylikecreateanewspritenameitcalculatorandthensayscratchblocksoknowitsgoodbuttheijustdon'tknowwhatanyofthoseblockswouldbeusedforbecauselikethemodblockjustdividessoliketheonlythingyoucoulduseitforwouldbelikeacalculatorprojectbecauseyoucouldsaylikecreateanewspritenameitcalculatorandthensayscratchblocksoknowitsgoodbuttheijustdon'tknowwhatanyofthoseblockswouldbeusedforbecauselikethemodblockjustdividessoliketheonlythingyoucoulduseitforwouldbelikeacalculatorprojectbecauseyoucouldsaylikecreateanewspritenameitcalculatorandthensayscratchblocksoknowitsgoodbuttheijustdon'tknowwhatanyofthoseblockswouldbeusedforbecauselikethemodblockjustdividessoliketheonlythingyoucoulduseitforwouldbelikeacalculatorprojectbecauseyoucouldsaylikecreateanewspritenameitcalculatorandthensayscratchblocksoknowitsuseitforwouldbelikeacalculatorprojectbecauseyoucouldsaylikecreateanewspritenameitcalculatorandthensayscratchblocksoknowitsgoodbuttheijustdon'tknowwhatanyofthoseblockswouldbeusedforbecauselikethemodblockjustdividessoliketheonlythingyoucoulduseitforwouldbelikeacalculatorprojectbecauseyoucouldsaylikecreateanewspritenameitcalculatorandthensayscratchblocksoknowitsgoodbuttheijustdon'tknowwhatanyofthoseblockswouldbeusedforbecauselikethemodblockjustdividessoliketheonlythingyoucoulduseitforwouldbelikeacalculatorprojectbecauseyoucouldsaylikecreateanewspritenameitcalculatorandthensayscratchblocksoknowitsgoodbuttheijustdon'tknowwhatanyofthoseblockswouldbeusedforbecauselikethemodblockjustdividessoliketheonlythingyoucoulduseitforwouldbelikeacalculatorprojectbecauseyoucouldsaylikecreateanewspritenameitcalculatorandthensayscratchblocksoknowitsgoodbuttheijustdon'tknowwhatanyofthoseblockswouldbeusedforbecauselikethemodblockjustdividessoliketheonlythingyoucoulduseitforwouldbelikeacalculatorprojectbecauseyoucouldsaylikecreateanewspritenameitcalculatorandthensayscratchblocksoknowitsgoodbuttheijustdon'tknowwhatanyofthoseblockswouldbeusedforbecauselikethemodblockjustdividessoliketheonlythingyoucoulduseitforwouldbelikeacalculatorprojectbecauseyoucouldsaylikecreateanewspritenameitcalculatorandthensayscratchblocksoknowitsgoodbuttheijustdon'tknowwhatanyofthoseblockswouldbeusedforbecauselikethemodblockjustdividessoliketheonlythingyoucoulduseitforwouldbelikeacalculatorprojectbecauseyoucouldsaylikecreateanewspritenameitcalculatorandthensayscratchblocksoknowitsgoodbuttheijustdon'tknowwhatanyofthoseblockswouldbeusedforbecauselikethemodblockjustdividessoliketheonlythingyoucoulduseitforwouldbelikeacalculatorprojectbecauseyoucouldsaylikecreateanewspritenameitcalculatorandthensayscratchblocksoknowitsgoodbuttheijustdon'tknowwhatanyofthoseblockswouldbeusedforbecauselikethemodblockjustdividessoliketheonlythingyoucoulduseitforwouldbelikeacalculatorprojectbecauseyoucouldsaylikecreateanewspritenameitcalculatorandthensayscratchblocksoknowitsgoodbuttheijustdon'tknowwhatanyofthoseblockswouldbeusedforbecauselikethemodblockjustdividessoliketheonlythingyoucoulduseitforwouldbelikeacalculatorprojectbecauseyoucouldsaylikecreateanewspritenameitcalculatorandthensayscratchblocksoknowitsgoodbuttheijustdon'tknowwhatanyofthoseblockswouldbeusedforbecauselikethemodblockjustdividessoliketheonlythingyoucoulduseitforwouldbelikeacalculatorprojectbecauseyoucouldsaylikecreateanewspritenameitcalculatorandthensayscratchblocksoknowitsgoodbuttheijustdon'tknowwhatanyofthoseblockswouldbeusedforbecauselikethemodblockjustdividessoliketheonlythingyoucoulduseitforwouldbelikeacalculatorprojectbecauseyoucouldsaylikecreateanewspritenameitcalculatorandthensayscratchblocksoknowitsgoodbuttheijustdon'tknowwhatanyofthoseblockswouldbeusedforbecauselikethemodblockjustdividessoliketheonlythingyoucoulduseitforwouldbelikeacalculatorprojectbecauseyoucouldsaylikecreateanewspritenameitcalculatorandthensayscratchblocksoknowitsgoodbuttheijustdon'tknowwhatanyofthoseblockswouldbeusedforbecauselikethemodblockjustdividessoliketheonlythingyoucoulduseitforwouldbelikeacalculatorprojectbecauseyoucouldsaylikecreateanewspritenameitcalculatorandthensayscratchblocksijustdontknowwhatyouwoulddowiththisblocklikewhat?:mad:definehowdoyoudothiswhatdoyoudowiththisblock?whatdoyoudowiththisblock?whatdoyoudowiththisblock?whatdoyoudowiththisblock?Mybrowser/operatingsystem:WindowsNT10.0,Chrome91.0.4472.77,NoFlashversiondetectedwiththissystemdoimissblocksimustuseforprojects?orsomething
samq64
Scratcher
1000+ posts

I need help with the mod and round blocks

To clear things up, here are the Scratch wiki articles:

Powered by DjangoBB