MCPcopy Create free account
hub / github.com/crawl/crawl / shuffle_array

Function shuffle_array

crawl-ref/source/random.h:272–281  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

270// I must be a random-access iterator.
271template <typename I>
272void shuffle_array(I begin, I end)
273{
274 size_t n = end - begin;
275 while (n > 1)
276 {
277 const int i = random2(n);
278 n--;
279 iter_swap(begin + i, begin + n);
280 }
281}
282
283template <typename T>
284void shuffle_array(T &vec)

Callers 15

nsubstMethod · 0.85
block_shuffleMethod · 0.85
fill_gizmo_propertiesFunction · 0.85
_rune_effectFunction · 0.85
_do_medusa_stingerFunction · 0.85
_train_skillsFunction · 0.85
_place_dragonFunction · 0.85
trigger_battlesphereFunction · 0.85
_paragon_tempestFunction · 0.85
cheibriados_time_stepFunction · 0.85
dithmenos_marionetteFunction · 0.85

Calls 2

random2Function · 0.85
endFunction · 0.85

Tested by

no test coverage detected