Solved A little bit of math

Discussion in 'Plugin Development' started by DoggyCode™, Jan 23, 2017.

Thread Status:
Not open for further replies.
  1. Offline

    DoggyCode™

    Ok,

    So I have an arraylist which i'm adding entries to. However, in entry 0 and entry 9, I'd like to add something different than the normal.

    So basically, every 45th iretation, i need to do something. How?
     
  2. Offline

    timtower Administrator Administrator Moderator

  3. @DoggyCode™
    Have an int with the current iteration, and each time, check if this int modulo 45 equals 0, and if so, do your special code.
     
    DoggyCode™ and JanTuck like this.
  4. Offline

    JanTuck

    You can use the % and check if iterations%45 == 0

    Sendt fra min ALE-L21 med Tapatalk
     
Thread Status:
Not open for further replies.

Share This Page