View Single Post
Old 01-23-2013, 08:24 PM   PM User | #9
Old Pedant
Supreme Master coder!

 
Old Pedant's Avatar
 
Join Date: Feb 2009
Posts: 23,579
Thanks: 62
Thanked 4,064 Times in 4,033 Posts
Old Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to all
I think it is way way past time that you show us your complete code *AS IT IS NOW*.

And I don't understand this part, at all:
Quote:
I don't know how to run the code through a browser
If you aren't running this code in a browser, how *ARE* you running it???

Oh...and finally...

This code:
Code:
if      (EXP<600)  {  plevel = 1; }
else if (EXP<700) { plevel = 2; }
else if (EXP<750) { plevel = 3; }
else if (EXP<900) { plevel = 4; }
else if (EXP<1000){plevel = 5; }
...
happens to be written in JavaScript, but the *logic* of it is universal. It would work the same in any computer language. Or in any human who applied the logic of it without a computer involved. So don't look at it as JavaScript code. Look at it from a logical viewpoint. Pick some EXP value (just for example, say 832, or choose one of your own) and then apply the logic/formulae there to see how it works.

You have to be able to express a problem in logical terms, in English or whatever your native language is, *FIRST*. Only then can you code it in the computer language of your choice.
__________________
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.
Old Pedant is offline   Reply With Quote