1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2025-10-20 16:37:40 +00:00

further cleanup

This commit is contained in:
Zeno Rogue
2019-08-10 01:56:00 +02:00
parent a0fcdb0c54
commit 609d1b91d3
10 changed files with 682 additions and 697 deletions

View File

@@ -176,6 +176,11 @@ EX int hrand(int i) {
return hrand(i);
}
#if HDR
template<class T, class... U> T pick(T x, U... u) { std::initializer_list<T> i = {x,u...}; return *(i.begin() + hrand(1+sizeof...(u))); }
template<class T> void hrandom_shuffle(T* x, int n) { for(int k=1; k<n; k++) swap(x[k], x[hrand(k+1)]); }
#endif
EX ld hrandf() {
return (hrngen() - hrngen.min()) / (hrngen.max() + 1.0 - hrngen.min());
}