Math Question

osucowboy18osucowboy18 Member Posts: 1,307
edited November -1 in Working with GS (Mac)
Hey everyone,

So I'm just about finished with version 2.0 of iJetSki, but want to include one last feature before I submit to Apple. Every 10 games the user plays, I want a message box to pop up asking the user if they want to rate my app. Can someone please provide a mathematical way of doing this besides if game.TimesPlayed = 10/20/etc, then show message box. Thanks.

- Alex

Comments

  • AsymptoteellAsymptoteell Member Posts: 1,362
    After it's ten, make it go back to 1 again instead of moving on to 11.
  • osucowboy18osucowboy18 Member Posts: 1,307
    WOW, why didn't I think of that :) Thanks Asymptoteell.

    - Alex
  • CodeMonkeyCodeMonkey Head Chef, Member, PRO Posts: 1,803
    here is the math way to do that:

    when you increment the game.TimesPlayed make it
    (games.TimesPlayed%10)+1
  • scitunesscitunes Member, Sous Chef Posts: 4,047
    CodeMonkey said:
    here is the math way to do that:

    when you increment the game.TimesPlayed make it
    (games.TimesPlayed%10)+1

    I thought it was (game.timesplayed+1)%10

    Have I been doing this wrong all along?
  • JGary321JGary321 Member Posts: 1,246
    scitunes said:
    I thought it was (game.timesplayed+1)%10

    Have I been doing this wrong all along?

    No CM is just losing his croutons that's all.
  • ToastKittenToastKitten Member Posts: 360
    scitunes's method would be used to check for 0 whenever the game has been played 10 times

    CM's method would be used to check for 1 whenever the game has been played 10 times

    you could really check for any number between 0 and 9 for either method, the difference is when it first returns true... every other time after that will be an increment of 10 from the first
  • osucowboy18osucowboy18 Member Posts: 1,307
    Thanks for your help guys, I just finished testing it, now I'm gonna submit version 2.0 of iJetSki to Apple!

    - Alex
Sign In or Register to comment.