GMLscripts.com

Discuss and collaborate on GML scripts
Invert

You are not logged in.

#1 2022-09-23 04:40:38

gnysek
Member
Registered: 2011-12-29
Posts: 30

array_shuffle

Expand/// @param {array} a
/// @returns {undefined}
function array_shuffle(a) {
	/// @returns {real}
	static _shuffle = function() {return choose(1, -1);}
	array_sort(a, _shuffle);
}

usage:

Expandvar a = [1, 2, 3, 4, 5, 6];
array_shuffle(a);
show_debug_message(a); // for example: [ 5,2,1,4,3,6 ]

Offline

Board footer

Powered by FluxBB