![]() |
Shutdown - Printable Version +- Mirage Source (https://mirage-engine.uk/forums) +-- Forum: Mirage Source (Nostalgia) (https://mirage-engine.uk/forums/forumdisplay.php?fid=61) +--- Forum: Archive (2006-2011) (https://mirage-engine.uk/forums/forumdisplay.php?fid=18) +---- Forum: Resources (https://mirage-engine.uk/forums/forumdisplay.php?fid=49) +---- Thread: Shutdown (/showthread.php?tid=323) |
Shutdown - William - 23-09-2006 Haha ![]() Make it 2000, or it wont be correct with the actual text that is sent to all players online. Or replace this: [code]Static Secs As Long If Secs - pingu - 23-09-2006 It'd be better if you changed the interval to 1000 and... [code]Static Secs As Long If Secs - William - 23-09-2006 Ill get my revenge when I have time in this topic ![]() - pingu - 23-09-2006 I just realized GSD did the same thing as I did, only he did it really badly and used a bunch of "if" statements. Bad GSD! Bad! - William - 23-09-2006 pingu Wrote:I just realized GSD did the same thing as I did, only he did it really badly and used a bunch of "if" statements. You scammer, stealing code ![]() - pingu - 23-09-2006 William Wrote:pingu Wrote:I just realized GSD did the same thing as I did, only he did it really badly and used a bunch of "if" statements. Eh, no... It's like this in Elysium (that means GSD coded it): [code]Static Secs As Long If Secs - William - 23-09-2006 Yep it is. Whats this in your other post: [code]If Secs Mod 5 = 0 Or Secs - Spodi - 23-09-2006 Mod returns the remainder, so Secs Mod 5 means if it is a perfect interval of 5, such as 5, 10, 15, 20, etc. - William - 23-09-2006 Spodi Wrote:Mod returns the remainder, so Secs Mod 5 means if it is a perfect interval of 5, such as 5, 10, 15, 20, etc. Okay, I need to go to my math classes, cause you lost me at remainder. Although I from sweden, so don't judge me ![]() - pingu - 23-09-2006 It's simply the "%" operation in most other languages. EDIT: Saw your post. 9 / 5 = 2 with 4 left over. "Mod" simply calculates what is left over. If 0 is left over, it's a perfect divide. - William - 23-09-2006 pingu Wrote:It's simply the "%" operation in most other languages.Okay, so that means Im stupid since I still dont understand it. WTG William! The "Secs" variable doesnt change, so why is there a need for Mod 5? - pingu - 23-09-2006 William Wrote:pingu Wrote:It's simply the "%" operation in most other languages.Okay, so that means Im stupid since I still dont understand it. WTG William! The "Secs" variable doesnt change, so why is there a need for Mod 5? Secs does change. Every second it is lowered by 1. - William - 23-09-2006 Yes, but in that if statement. Code: If Secs = Should not change by adding Mod 5. - pingu - 23-09-2006 William Wrote:Yes, but in that if statement. Secs is "Static", meaning it acts just like a global variable. You might not get that part. - William - 23-09-2006 Now I understand ![]() PingusIQ = 100 Mod 5 Which means it is 20 ![]() Well anyway, that should be correct, but this one yeah ![]() PingusDadsShoeSize = 2150 Mod 37.8 = 56,878306878306878306878306878307 = 55 ???? noo,, I dont think I understand now.. DAMMIT! EDIT: I know what static is, dont insult me.. Im not retarded ![]() - William - 23-09-2006 Verrigan Wrote:William Wrote:PingusIQ = 100 Mod 5 So if the outcome is a whole number, its always zero? And elseif its something else like 67, it would be 70 ? :oops: - William - 23-09-2006 Verrigan Wrote:99 Mod 5 would be 4 (99 / 5 = 19 with 4 remaining) 99 / 5 = 19,8 which means 0.8 remaing? Where do you get the 4 from? - pingu - 23-09-2006 Look, I managed to think up a formula to help you. If you do: Num1 Mod Num2 It translates to: Num1 - (Num2 * Int(Num1 / Num2)) - William - 23-09-2006 pingu Wrote:Look, I managed to think up a formula to help you. That I understand. But isnt there something called: what you dont know doesn't hurt you. And to translate that into a coding statement. What you can't code correctly, program around it, if you can't program around it: dig a hole, lay down, and beg for someone to fill the hole. Discussion Closed. I still don't understand fully, but I don't want to. Just so everybody know, Im a "A" student in Mathematics (studying on IB). - pingu - 23-09-2006 Would you mind not flipping out on us? This isn't about your grade in math, it's about understanding a very useful operation that you will need for programming in any language. Okay, I'll try once more to explain, but I'll try to jam everything into one post. Don't get intimidated because this operator is text instead of a symbol. It doesn't make much sense because it isn't a function, but an operator. I'm going to use the "@" symbol instead of "Mod" (or "%", because that get's confused with percentage). Got it? So, sample problem number 1 goes like this: 13 @ 5 = ? Now, take it in steps. Find out what "13 / 5" equals. It's 2.6, but there is a nasty decimal at the end. We don't want him so we round down to 2. Now we need to multiply this 2 by the number we divided by. Normally, this would give you the same number you started with (13), but because we rounded down, it won't. 5 * 2 = 10 We now have 10. This is telling us that 10 is the highest number below 13 that can be divided by 5 evenly. Knowing that, we just compare 10 and 13. 13 - 10 = 3 3 is our answer. The remainder of a division problem is the difference between the closest perfect divide (that means that it doesn't have a decimal answer) and the number we started with. I don't know how you learn, so I'm going to try it in terms of fractions. 67 @ 10 = ? Let's divide using the calculator first. 67 / 10 = 6.7 In this method, we don't throw the decimal out yet. I've used "10" to make this much easier to do. Split the number according to the space right before the decimal. So, we have: 6 And .7 We need to figure out what .7 is in terms of something over 10 (If it were 67 @ 8, we'd figure it out over 8 instead. Yhis rule applies for all problems, not just 10 and 8!) x / 10 = .7 Simple algebra here. Multiply both sides by 10 and you get: x = 7 Guess what? The answer is 7. If we were in school and had to divide and find that remainder, 6 would be the answer (67 / 10 rounded down) and 7 would be the remainder (67 @ 10). I hope I kind of help. It's easiest to use mod with 10, because it works perfectly. 85 @ 10 = 5 42 @ 10 = 2 70 @ 10 = 0 But, as I showed... 30 @ 5 = 0 29 @ 5 = 4 28 @ 5 = 3 27 @ 5 = 2 26 @ 5 = 1 25 @ 5 = 0 You'll get used to it. I do it in my head a slightly different way. I round up instead and then subtract the other way, but they both work. - Spodi - 23-09-2006 He's just trying to help you, William... Especially if you're taking math, you should know how to do this. Remainders are something you deal with when you first learn division in elementary school. If you dont know it now, you are going to be screwed later on if you ever need to use it again. And grades only show how much you study what is being taught at the time, not how good you are at the subject. - William - 15-02-2007 hehe.. Just read the first posts and understood it now ![]() |