playMaker

Author Topic: "Is Int a Multiple of Another Int?"[SOLVED]  (Read 1890 times)

westingtyler

  • Sr. Member
  • ****
  • Posts: 277
    • My Video Game Projects Web Site
"Is Int a Multiple of Another Int?"[SOLVED]
« on: October 08, 2018, 11:26:21 PM »
depending on a setting, i want a sound to play every time a loop count int is a multiple of a certain number, during a looping process. (sound on string typwriter-ing.)

Is (Current Loop Int) a Multiple of 5? YES/NO.

Is (Current Loop Int) a Multiple of 9? YES/NO.
« Last Edit: October 11, 2018, 04:43:24 AM by jeanfabre »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: "Is Int a Multiple of Another Int?"
« Reply #1 on: October 11, 2018, 04:43:09 AM »
Hi,

 for this, you need to check the modulus.

https://stackoverflow.com/questions/3216496/c-sharp-how-to-determine-if-a-number-is-a-multiple-of-another

Look for the IntModulo  custom action on the Ecosystem

Bye,

 Jean