지금까지 내용 커밋
This commit is contained in:
15
bot/src/utils/shuffle.ts
Normal file
15
bot/src/utils/shuffle.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
export const fshuffle = (list: any[]): any[] => {
|
||||
var i, j, x;
|
||||
for (i=list.length; i; i-=1) {
|
||||
j = Math.floor(Math.random()*i);
|
||||
x = list[i-1];
|
||||
list[i-1] = list[j];
|
||||
list[j] = x;
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
export const shuffle = (list: any[]): any[] => {
|
||||
for (let z=0; z<5; z++) list = fshuffle(list);
|
||||
return list;
|
||||
}
|
||||
Reference in New Issue
Block a user