Charas-Project
Off-Topic => Archive => Old Game Discussion => Topic started by: just1question on November 07, 2004, 08:01:33 PM
-
OK, does ANYONE know what the "modulus" option in variables does? I know, it may not mean anything at all in the end to my game, but I'm getting pretty curious. Every forum I go to says "don't worry about it," or, "I don't know and I don't care." I really don't need to know, I'm sure, but hey, what if it IS something I could use? What is it?
-
I'm not sure, but it'd be best not to use it. I've never need to use mor than 3 of the variable options anyways.
-
From the helpfiles -
-> Modulus : Divides the specified value by the value already held in the variable and returns the remainder. (Example: If the specified value is 10, and the value held in the variable is 1234, modulus will return 4.)
So... maybe.... hmmmmm... confusing. Oh, wait, I get it. Long division.
So if the value in the var was 39 and the set the var to modular 3, then it would return 0, because there's no remained when dividing 39 by 3. As for why you'd need this, I can't say.
-
Why the hell would anyone need that? I guess Japanese people are so mathematical that they incorperate it even when they don't need too.
-
Perhaps calculating the remainder left over to display the correct number of symbols?
Like you want to show apples, but to save space you have a picture of a row of ten apples, and then a single apple picture. You divide by ten to get the number of "ten" rows, and then modulus to get the remaining number of apples.
-
There's already been a thread about this, and I already showed how useful Mod is.
I use ot to easily show a digit in a number.
Ex. If I have 458, I can easily get 4, 5, or 8.
-
True. I like my apples example better, though.
-
It's practically REQUIRED if ya wanna make a CBS.