From 0f5f1ade0b446cffc2a1546dab5e5677f83c520a Mon Sep 17 00:00:00 2001 From: Anhgelus Morhtuuzh Date: Tue, 13 May 2025 23:44:16 +0200 Subject: [PATCH] perf(xp): simplify function LevelXP --- README.md | 2 +- exp/functions.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index f71a0f0..5b49b14 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ Functions: message (number of different rune) - $xp-vocal(x)=0.01 x^{1.3}+1$ where $x$ is the time spent in vocal (in second) - $level(x)=0.2 \sqrt{x}$ where $x$ is the xp -- $level^{-1}(x)=(5x)^2$ where $x$ is the level +- $level^{-1}(x)=25x^2$ where $x$ is the level ## Installation diff --git a/exp/functions.go b/exp/functions.go index 720a755..119b6a8 100644 --- a/exp/functions.go +++ b/exp/functions.go @@ -42,7 +42,7 @@ func Level(xp uint) uint { // See Level to get the level with the given XP. func LevelXP(level uint) uint { return uint(math.Floor( - math.Pow(float64(5*level), 2), + 25 * math.Pow(float64(level), 2), )) }