Can anybody help me? I really want to know what the mod command means so i can use it in one of my games.
Offline
"mod" is short for "modulo". This function returns the remainder of division. It's useful for a series of numbers that "wraps around".
One example would be a clock. Hours progress from 1 o 12, but there isn't "13 o'clock", it's just "1 o'clock" again.
13 mod 12 is 1, 14 mod 12 is 2, 31 mod 12 is 7.
(In military time, the clock counts up to 24, so you'd use "mod 24".)
I've seen mod used in scratch, but have to admit I've never used it. I suspect I've needed it before, but figured out a way to do without it. (I'm certain the workaround isn't as "elegant" as the proper use of it!)
Offline
EdnaC explained it very well, but if you would like further explanation and examples, you may wish to read the Wiki page on the subject. I've used the mod block in many projects so if you would like to see those projects or have any questions, let me know.
Offline