EQ2Interface.com
Search Downloads


Go Back   EQ2Interface > General Discussion > Chit-Chat

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #7  
Unread 04-05-2009, 07:04 PM
Drumstix42's Avatar
Drumstix42 Drumstix42 is offline
A Griffon
Featured
 
Join Date: Oct 2004
Server: Antonia Bayle
Posts: 3,287
Default

gm9 is correct. Mathematically the returned value for the mission # can never be greater than 18. The modulus operator is pretty cool and I personally only knew of it's existence in probably the past year or so and never knew a good reason to use it.

I realize now I could probably just use array_size or something, instead of having the hard-coded number 19, but oh well. And yes it allows easily to add/remove missions should it be necessary.

It's simple division, between two numbers, but the % sign uses the remainder, so that the number can never be more than 18.

0%19 = 0 (0 is mission #1 starting at 0 in code)
10%19 = 10
18%19 = 18 (18 is mission #19 since we started at 0 in code)
19%19 = 0 (0 would be the first mission, starting the cycle over)
__________________
"I'm afraid you're guilty of thought-crime. Don't bother getting the door, we'll let ourselves in..."
<Donate to DrumsUI> < [DrumsUI] Updater > < [DrumsUI] Full Interface> < Drumstix42 on Twitch.tv
>
Reply With Quote
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 02:38 PM.


Our Network
EQInterface | EQ2Interface | WoWInterface | LoTROInterface | ESOUI | MMOUI