12 lines
202 B
Go
12 lines
202 B
Go
|
package utils
|
||
|
|
||
|
import "math"
|
||
|
|
||
|
func ExpToLevel(exp int) int {
|
||
|
return int(math.Floor((math.Sqrt(625+100*float64(exp))-25)/50)) + 1
|
||
|
}
|
||
|
|
||
|
func LevelToExp(level int) int {
|
||
|
return 25*level*level - 25*level
|
||
|
}
|