aboutsummaryrefslogtreecommitdiffstats
path: root/util/array.lua
diff options
context:
space:
mode:
Diffstat (limited to 'util/array.lua')
-rw-r--r--util/array.lua8
1 files changed, 8 insertions, 0 deletions
diff --git a/util/array.lua b/util/array.lua
index f1f8fa97..9e99a3ec 100644
--- a/util/array.lua
+++ b/util/array.lua
@@ -44,4 +44,12 @@ function array:shuffle()
end
end
+function array:reverse()
+ local len = #self-1;
+ for i=len,1,-1 do
+ self:push(self[i]);
+ self:pop(i);
+ end
+end
+
_G.array = array