From 9384f5399da39e53855beb8e7f8ded1aa56bf72e Mon Sep 17 00:00:00 2001 From: syuilo Date: Tue, 27 Dec 2022 14:36:33 +0900 Subject: rename: client -> frontend --- packages/client/src/scripts/shuffle.ts | 19 ------------------- 1 file changed, 19 deletions(-) delete mode 100644 packages/client/src/scripts/shuffle.ts (limited to 'packages/client/src/scripts/shuffle.ts') diff --git a/packages/client/src/scripts/shuffle.ts b/packages/client/src/scripts/shuffle.ts deleted file mode 100644 index 05e6cdfbcf..0000000000 --- a/packages/client/src/scripts/shuffle.ts +++ /dev/null @@ -1,19 +0,0 @@ -/** - * 配列をシャッフル (破壊的) - */ -export function shuffle(array: T): T { - let currentIndex = array.length, randomIndex; - - // While there remain elements to shuffle. - while (currentIndex !== 0) { - // Pick a remaining element. - randomIndex = Math.floor(Math.random() * currentIndex); - currentIndex--; - - // And swap it with the current element. - [array[currentIndex], array[randomIndex]] = [ - array[randomIndex], array[currentIndex]]; - } - - return array; -} -- cgit v1.2.3-freya