aboutsummaryrefslogtreecommitdiffstats
path: root/src/app/game/game.utils.ts
diff options
context:
space:
mode:
authorPinapelz <yukais@pinapelz.com>2026-04-16 17:22:27 -0700
committerPinapelz <yukais@pinapelz.com>2026-04-16 17:22:27 -0700
commit5709b7323ca39dd1397720fc0b13a587638967f1 (patch)
tree59e643ee6243b2d54a24ff121f6f615a359b3371 /src/app/game/game.utils.ts
parentd5fe045b361a3735509bfa2549efa0bd185bc7de (diff)
add estimated CPS needed to type current line
Diffstat (limited to 'src/app/game/game.utils.ts')
-rw-r--r--src/app/game/game.utils.ts4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/app/game/game.utils.ts b/src/app/game/game.utils.ts
index 6177d2c..4c99c55 100644
--- a/src/app/game/game.utils.ts
+++ b/src/app/game/game.utils.ts
@@ -42,6 +42,10 @@ export function parseLrcLines(lrcText: string): GameLine[] {
return result;
}
+export function calculateCPSNeeded(text: string, seconds: number): number {
+ return text.length / seconds;
+}
+
export function formatTime(ms: number): string {
const s = Math.max(0, Math.floor(ms / 1000));
return `${Math.floor(s / 60)}:${String(s % 60).padStart(2, "0")}`;
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage