Shuffles the values in the given list to a random order.


GML Code Example


Argument Description
id The id of the list to shuffle.

Returns: N/A


With this function you can shuffle a list, which will re-order all the component values into random positions from those in which they were originally added to the list.

NOTE: This function will shuffle the list items to the same positions every time the game is run afresh due to the fact that GameMaker: Studio generates the same initial random seed every time to make debugging code a far easier task. To avoid this behaviour use randomize at the start of your game. This is only true when testing and debugging the game, as the final executable package will not show this behaviour and will be random every play.


GML Code Example

if restart

The above code will shuffle the list indexed in the variable "card_list" if the variable "restart" is flagged as true.

Back: DS Lists

No Examples Submitted

Does this page need better examples? Be the first to Submit

No Edits Suggested

Is this page unclear or not descriptive enough? Suggest an edit to the page and with enough upvotes your changes will be made.

No Questions Have Been Ask

Do you have a question about this page? Ask it Here