Mathematical problem
Posted
by coolboycsaba
on Stack Overflow
See other posts from Stack Overflow
or by coolboycsaba
Published on 2010-05-14T21:57:58Z
Indexed on
2010/05/14
22:04 UTC
Read the original article
Hit count: 289
mathematical
|problem
I have the following function:
function getLevel(points)
{
var level = -1 + Math.sqrt(4 + points/20);
// Round down to nearest level
return Math.floor(level);
}
The above function calculates the level of a player based on their points, my problem is that I need a function like this to calculate the points needed for a given level.
© Stack Overflow or respective owner