MCPcopy Index your code
hub / github.com/codecombat/codecombat / levelFromExp

Method levelFromExp

app/models/User.js:386–388  ·  view source on GitHub ↗
(xp)

Source from the content-addressed store, hash-verified

384
385 // y = a * ln(1/b * (x + c)) + 1
386 static levelFromExp (xp) {
387 if (xp > 0) { return Math.floor(a * Math.log((1 / b) * (xp + c))) + 1 } else { return 1 }
388 }
389
390 // x = b * e^((y-1)/a) - c
391 static expForLevel (level) {

Callers 6

User.spec.jsFile · 0.80
updateXPBarsMethod · 0.80
getCancellationsMethod · 0.80
getSubscribersMethod · 0.80
levelMethod · 0.80
updateXPBarsMethod · 0.80

Calls 1

logMethod · 0.80

Tested by

no test coverage detected