From 0a4f0daa94d133751aea9387147cf18aace1635c Mon Sep 17 00:00:00 2001 From: Chris Danford Date: Mon, 23 May 2005 19:49:02 +0000 Subject: [PATCH] add tableshuffle --- stepmania/Themes/default/Scripts/Utilities.lua | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/stepmania/Themes/default/Scripts/Utilities.lua b/stepmania/Themes/default/Scripts/Utilities.lua index d0a66a25bf..1c0cf2c5e3 100644 --- a/stepmania/Themes/default/Scripts/Utilities.lua +++ b/stepmania/Themes/default/Scripts/Utilities.lua @@ -92,6 +92,14 @@ function fapproach( val, other_val, to_move ) return val end +function tableshuffle( t ) + local ret = { } + for i=1,table.getn(t) do + table.insert( ret, math.random(i), t[i] ); + end + return ret +end + -- (c) 2005 Glenn Maynard, Chris Danford -- All rights reserved. --