Flash Website Builder- Trendy Site Builder is a Flash Site Building tool that helps users build stunning websites. Check Out Custom Custom Logo Design by LogoBee. Website Design and Free Logo Templates available.
 CodingForums.com Coding a Forum Level Up System

Before you post, read our: Rules & Posting Guidelines

Enjoy an ad free experience by logging in. Not a member yet? Register.
 01-23-2013, 10:24 PM PM User | #16 FrostWyrmWraith New Coder   Join Date: Jan 2013 Posts: 12 Thanks: 0 Thanked 0 Times in 0 Posts Okay, then please explain where you got 50. It should quite clearly be 2500 because as I said earlier, I calculated these based on a post count of 50. I find it funny that you claim to be a mathematician but get these simple things utterly wrong.
01-23-2013, 10:29 PM   PM User | #17
Regular Coder

Join Date: Jan 2013
Location: Germany
Posts: 578
Thanks: 4
Thanked 77 Times in 77 Posts
Oops – in my head I just had EXP = 50 instead of EXP = 50 * 50. Well, in any case that would make it be 500. Not the 200 you for whatever reason expect.

Quote:
 I find it funny that you claim to be a mathematician but get these simple things utterly wrong.
show me I don't need to waste any more time trying to understand horrible code. It's fascinating what attitude people have towards others who try to help them for free(!). I don't need to prove to you that I studied mathematics, just as I don't need to listen to you accusing me of lying. Maybe others will continue to help you, although I certainly don't hope that they will.

Bye.

Last edited by Airblader; 01-23-2013 at 10:34 PM..

 01-23-2013, 10:46 PM PM User | #18 FrostWyrmWraith New Coder   Join Date: Jan 2013 Posts: 12 Thanks: 0 Thanked 0 Times in 0 Posts Help me? You've been nothing but condescending this whole time. I'm new at this, and your attitude has not been helping. And no, by the way, 500*1.15^12 does not equal 3000. Nice try though?
 01-23-2013, 10:51 PM PM User | #19 Airblader Regular Coder   Join Date: Jan 2013 Location: Germany Posts: 578 Thanks: 4 Thanked 77 Times in 77 Posts
 01-23-2013, 11:30 PM PM User | #20 Old Pedant Supreme Master coder!     Join Date: Feb 2009 Posts: 24,965 Thanks: 75 Thanked 4,309 Times in 4,276 Posts Okay... Code: ```var xpup = (xneeded * Math.ceil(Math.pow(1.15, plevel))) var showxp= (xpup - (xneeded * Math.ceil(Math.pow(1.15, plevel-1)))) NewCode = topR + midR + name + ": " + sign +" "+ plevel + "
XP: "+ (EXP-showxp) +"
Experience needed: " + (xpup-EXP)+ "
Overall Experience:" + (xneeded * EXP / xneeded) +"

"``` So Code: ```xpup = 500 * Math.ceil( Math.pow(1.15, 12) ) ==>> xpup = 500 * Math.ceil( 5.35 ) ==>> xpup = 500 * 6 ==>> xpup = 3000 showxp= (xpup - (xneeded * Math.ceil(Math.pow(1.15, plevel-1)))) ==>> showxp = (3000 - (500 * Math.ceil( Math.pow( 1.15, 11 ) ) ) ) ==>> showxp = (3000 - (500 * Math.ceil( 4.65 ) ) ) ==>> showxp = (3000 - (500 * 5) ) ==>> showxp = 3000 - 2500 ==>> showxp = 500 NewCode = "...other stuff..."+ plevel + "
XP: "+ (EXP-showxp) + "
Experience needed: " + (xpup-EXP) + "
Overall Experience:" + (xneeded * EXP / xneeded) + ... NewCode = "...other stuff..."+ 12 + "
XP: "+ (2500-500) + "
Experience needed: " + (3000-500) + "
Overall Experience:" + (500 * 2500 / 500) + ... NewCode = "...other stuff..."+ 12 + "
XP: "+ 2000 + "
Experience needed: " + 2500 + "
Overall Experience:" + 2500 + ...``` This expression is especially silly: (xneeded * EXP / xneeded) Pointless. The two uses of xneeded cancel out, so the value is always simply EXP. __________________ An optimist sees the glass as half full. A pessimist sees the glass as half empty. A realist drinks it no matter how much there is.
01-23-2013, 11:32 PM   PM User | #21
Old Pedant
Supreme Master coder!

Join Date: Feb 2009
Posts: 24,965
Thanks: 75
Thanked 4,309 Times in 4,276 Posts
Quote:
 Originally Posted by FrostWyrmWraith And no, by the way, 500*1.15^12 does not equal 3000.
True. But that is *NOT* what your JavaScript says or does.

Quote:
 var xpup = 500 * Math.ceil( Math.pow(1.15, 12) );
And because of the Math.ceil( ) in there, xpup *DOES* then equal 3000.

500*1.15^12 is actually 2675.1250527368555908203125
__________________
An optimist sees the glass as half full.
A pessimist sees the glass as half empty.
A realist drinks it no matter how much there is.

Last edited by Old Pedant; 01-23-2013 at 11:36 PM..

 01-24-2013, 12:59 AM PM User | #22 FrostWyrmWraith New Coder   Join Date: Jan 2013 Posts: 12 Thanks: 0 Thanked 0 Times in 0 Posts The (xneeded * EXP/xneeded) was there in the original coding. Okay, so my dumb head head thought it was rounding it up to 2700. Actually I'm not sure where I got that impression, to be honest. Thank you for specifying why was becoming 3000. Is there a way to make it round up just to the next number divisible by 50?
 01-24-2013, 01:26 AM PM User | #23 Old Pedant Supreme Master coder!     Join Date: Feb 2009 Posts: 24,965 Thanks: 75 Thanked 4,309 Times in 4,276 Posts var xpup = 50 * Math.ceil( 500 * Math.pow(1.15, plevel) / 50 ); For a plevel of 12, that give xpup of 2700. var showxp= xpup - 50 * Math.ceil( 500 * Math.pow(1.15, plevel-1) / 50 ); Again, for a plevel of 12 (with xpup of 2700) that will do var showxp = 2700 - 2350; or showxp = 350 __________________ An optimist sees the glass as half full. A pessimist sees the glass as half empty. A realist drinks it no matter how much there is.
 01-24-2013, 01:31 AM PM User | #24 Old Pedant Supreme Master coder!     Join Date: Feb 2009 Posts: 24,965 Thanks: 75 Thanked 4,309 Times in 4,276 Posts And then Code: ```NewCode = "...other stuff..."+ plevel + "
XP: "+ (EXP-showxp) + "
Experience needed: " + (xpup-EXP) + "
Overall Experience:" + (xneeded * EXP / xneeded) + ... NewCode = "...other stuff..."+ 12 + "
XP: "+ (2500-350) + "
Experience needed: " + (2700-2500) + "
Overall Experience:" + (500 * 2500 / 500) + ... NewCode = "...other stuff..."+ 12 + "
XP: "+ 2150 + "
Experience needed: " + 200 + "
Overall Experience:" + 2500 + ...``` __________________ An optimist sees the glass as half full. A pessimist sees the glass as half empty. A realist drinks it no matter how much there is.
 01-24-2013, 02:50 AM PM User | #25 FrostWyrmWraith New Coder   Join Date: Jan 2013 Posts: 12 Thanks: 0 Thanked 0 Times in 0 Posts Okay, I actually think I get that. It worked, thanks!

 Bookmarks

 Thread Tools Rate This Thread Rate This Thread: 5 : Excellent 4 : Good 3 : Average 2 : Bad 1 : Terrible

 Posting Rules You may not post new threads You may not post replies You may not post attachments You may not edit your posts BB code is On Smilies are On [IMG] code is On HTML code is Off Forum Rules
 Forum Jump User Control Panel Private Messages Subscriptions Who's Online Search Forums Forums Home :: Client side development     JavaScript programming         DOM and JSON scripting         Ajax and Design         JavaScript frameworks         Post a JavaScript     HTML & CSS     XML     Flash & ActionScript         Adobe Flex     Graphics and Multimedia discussions     General web building         Site reviews         Building for mobile devices :: Server side development     Apache configuration     Perl/ CGI     PHP         Post a PHP snippet     MySQL         Other Databases     Ruby & Ruby On Rails     ASP     ASP.NET     Java and JSP     Other server side languages/ issues         ColdFusion         Python :: Computing & Sciences     Computer Programming     Computer/PC discussions     Geek News and Humour Web Projects and Services Marketplace     Web Projects         Small projects (quick fixes and changes)         Medium projects (new script, new features, etc)         Large Projects (new web application, complex features etc)         Unknown sized projects (request quote)         Vacant job positions         Looking for work/ for hire         Project collaboration/ partnership         Paid work offers and requests (Now CLOSED)     Career, job, and business ideas or advice     Domains, Sites, and Designs for sale         Domains for sale         Websites for sale         Design templates and graphics for sale :: Other forums     Member Offers     Forum feedback and announcements

All times are GMT +1. The time now is 06:32 PM.