MCPcopy Create free account
hub / github.com/DFHack/dfhack / permute

Function permute

library/include/modules/Random.h:92–98  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

90
91 template<class T>
92 void permute(T *p, int size) {
93 while(size > 1)
94 {
95 int j = random(size--);
96 T c = p[j]; p[j] = p[size]; p[size] = c;
97 }
98 }
99 };
100
101#ifndef DFHACK_RANDOM_CPP

Callers

nothing calls this directly

Calls 1

randomFunction · 0.85

Tested by

no test coverage detected