aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/client/utils/shuffle.ts
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2026-02-08 21:18:55 +0900
committernsfisis <nsfisis@gmail.com>2026-02-08 21:18:55 +0900
commit5e7c3ad7ed8c287b538de97d4de3a4df87e9a100 (patch)
treea3b400fb00ba9544d51640cb5d6eb494c2b095f3 /src/client/utils/shuffle.ts
parente17c87441d9beff9c1241cbe3ba71c402a7c0c3f (diff)
downloadkioku-5e7c3ad7ed8c287b538de97d4de3a4df87e9a100.tar.gz
kioku-5e7c3ad7ed8c287b538de97d4de3a4df87e9a100.tar.zst
kioku-5e7c3ad7ed8c287b538de97d4de3a4df87e9a100.zip
feat(study): use seeded PRNG for deterministic card shuffle order
Shuffle order is now fixed within a study day by seeding mulberry32 with the study day boundary timestamp (3:00 AM rollover). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Diffstat (limited to 'src/client/utils/shuffle.ts')
-rw-r--r--src/client/utils/shuffle.ts14
1 files changed, 0 insertions, 14 deletions
diff --git a/src/client/utils/shuffle.ts b/src/client/utils/shuffle.ts
deleted file mode 100644
index a2b8fec..0000000
--- a/src/client/utils/shuffle.ts
+++ /dev/null
@@ -1,14 +0,0 @@
-/**
- * Fisher-Yates shuffle algorithm.
- * Returns a new shuffled array (does not mutate the original).
- */
-export function shuffle<T>(array: T[]): T[] {
- const result = [...array];
- for (let i = result.length - 1; i > 0; i--) {
- const j = Math.floor(Math.random() * (i + 1));
- const temp = result[i] as T;
- result[i] = result[j] as T;
- result[j] = temp;
- }
- return result;
-}