Charas-Project

Off-Topic => Archive => Old Game Discussion => Topic started by: just1question on November 07, 2004, 08:01:33 PM

Title: Modulus in variables...
Post 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?
Title:
Post by: AsakuraHao2004 on November 07, 2004, 08:18:19 PM
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.
Title:
Post by: Osmose on November 07, 2004, 08:21:06 PM
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.
Title:
Post by: AsakuraHao2004 on November 07, 2004, 08:24:32 PM
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.
Title:
Post by: Osmose on November 07, 2004, 08:38:17 PM
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.
Title:
Post by: Ruler of the Dark on November 07, 2004, 08:51:48 PM
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.
Title:
Post by: Osmose on November 07, 2004, 08:59:43 PM
True. I like my apples example better, though.
Title:
Post by: Red Giant on November 12, 2004, 09:09:19 PM
It's practically REQUIRED if ya wanna make a CBS.