aboutsummaryrefslogtreecommitdiffstats
path: root/src/server/Utils.hx
diff options
context:
space:
mode:
Diffstat (limited to 'src/server/Utils.hx')
-rw-r--r--src/server/Utils.hx11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/server/Utils.hx b/src/server/Utils.hx
index c3510c9..2ecbd42 100644
--- a/src/server/Utils.hx
+++ b/src/server/Utils.hx
@@ -27,4 +27,15 @@ class Utils {
}
return "127.0.0.1";
}
+
+ public static function shuffle<T>(arr:Array<T>):Void {
+ for (i in 0...arr.length) {
+ final n = Std.random(arr.length);
+ final a = arr[i];
+ final b = arr[n];
+ arr[i] = b;
+ arr[n] = a;
+ }
+ }
+
}
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage