|
|
@ -9,6 +9,15 @@
|
|
|
|
return Array.prototype.slice.call(A, start, end);
|
|
|
|
return Array.prototype.slice.call(A, start, end);
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Util.shuffleArray = function (a) {
|
|
|
|
|
|
|
|
for (var i = a.length - 1; i > 0; i--) {
|
|
|
|
|
|
|
|
var j = Math.floor(Math.random() * (i + 1));
|
|
|
|
|
|
|
|
var tmp = a[i];
|
|
|
|
|
|
|
|
a[i] = a[j];
|
|
|
|
|
|
|
|
a[j] = tmp;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
Util.bake = function (f, args) {
|
|
|
|
Util.bake = function (f, args) {
|
|
|
|
if (typeof(args) === 'undefined') { args = []; }
|
|
|
|
if (typeof(args) === 'undefined') { args = []; }
|
|
|
|
if (!Array.isArray(args)) { args = [args]; }
|
|
|
|
if (!Array.isArray(args)) { args = [args]; }
|
|
|
|