MCPcopy Create free account
hub / github.com/Moli-X/Resources / shuffle

Function shuffle

Script/Parser.js:2187–2196  ·  view source on GitHub ↗
(arr)

Source from the content-addressed store, hash-verified

2185}
2186// 随机洗牌排序
2187function shuffle(arr) {
2188 var input = arr;
2189 for (var i = input.length - 1; i >= 0; i--) {
2190 var randomIndex = Math.floor(Math.random() * (i + 1));
2191 var itemAtIndex = input[randomIndex];
2192 input[randomIndex] = input[i];
2193 input[i] = itemAtIndex;
2194 }
2195 return input;
2196}
2197
2198//根据指定规则排序
2199function Sort_KWD (cnt,strs) {

Callers 1

QXSortFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected