feat(tools): add get_random_words tool with Fisher-Yates shuffle
This commit is contained in:
5
services/randomWord.ts
Normal file
5
services/randomWord.ts
Normal file
@@ -0,0 +1,5 @@
|
||||
import fishersYatesShuffle from "@/helpers/shuffle"
|
||||
|
||||
export const getRandomWords = (words: string[], count: number) => {
|
||||
return fishersYatesShuffle(words).slice(0, count)
|
||||
}
|
||||
Reference in New Issue
Block a user