GameSalad

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Check if it is Odd, Even, Rational, Irrational, whole, etc...

cwbh10cwbh10 Posts: 52Member
edited 11:45AM in Tech Support
I wanted to have a simple rule to check when the time passed when divided by a number say... 9 will be even/whole. So that everytime it reports even it changes a setting. I guess i could keep it whole by using integers? Help would be nice :)

Comments

  • xarmianxarmian Posts: 124Member
    Use modulous.. if (time % 9) = 0 then { do something }, mod is the remainder after dividing by the modulo number, so 10%9 = 1, 20%9 = 2, 9%9 = 0, 18%9 = 0, etc, so if you're doing seconds, then every 9th second time%9 = 0.
  • cwbh10cwbh10 Posts: 52Member
    Oh! Thanks! I can't believe didn't think of that... :p

    Have a good one! :)
This discussion has been closed.