MCPcopy Create free account
hub / github.com/esengine/esengine / shuffleCopy

Function shuffleCopy

packages/procgen/src/random/Shuffle.ts:32–34  ·  view source on GitHub ↗
(array: readonly T[], rng: SeededRandom | { next(): number })

Source from the content-addressed store, hash-verified

30 * @returns @zh 洗牌后的新数组 @en New shuffled array
31 */
32export function shuffleCopy<T>(array: readonly T[], rng: SeededRandom | { next(): number }): T[] {
33 return shuffle([...array], rng);
34}
35
36/**
37 * @zh 从数组中随机选择一个元素

Callers 1

sampleFunction · 0.85

Calls 1

shuffleFunction · 0.85

Tested by

no test coverage detected