Skip to content

Commit 48d4cd3

Browse files
authored
Merge pull request #45 from lactf/curve
new curve
2 parents 4cc4f7e + 1cd3098 commit 48d4cd3

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

server/util/scores.ts

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,13 @@
77
// min(max(428 * (0.995) ** solves + 75, 428 * (0.9978) ** solves, 100), 500)
88
//
99
// put below into desmos to see curve:
10-
// y_{2}=428\left(.995\right)^{x}+75
11-
// y_{3}=428\left(.9978\right)^{x}
12-
// y=\min\left(\max\left(y_{2},\ y_{3},\ 100\right),\ 500\right)
10+
// y_{2}=428\left(.99\right)^{x}+75
11+
// y_{3}=428\left(b\right)^{\left(x+a\right)}
12+
// b=0.9984
13+
// a=53
14+
// y=\min\left(\max\left(y_{2},y_{3},100\right),\ 500\right)
1315
export const getScore = (rl: number, rh: number, maxSolves: number, solves: number): number => {
14-
const hardCurve = 428 * (0.995) ** solves + 75;
15-
const easyCurve = 428 * (0.9978) ** solves;
16-
const veryEasyCurve = -0.055 * solves + 150;
17-
return Math.round(Math.min(Math.max(hardCurve, easyCurve, veryEasyCurve, rl), rh));
16+
const hardCurve = 428 * (0.99) ** solves + 76;
17+
const easyCurve = 428 * (0.9984) ** (solves + 53);
18+
return Math.round(Math.min(Math.max(hardCurve, easyCurve, rl), rh));
1819
}

0 commit comments

Comments
 (0)