qc.Math.shuffle

Prototype

  • Array shuffle(Array)

Paramters

Paramter Type Description
array Array The array to shuffle.
return Array The shuffled array.

Description

Shuffles the data in the given array into a new order.

Example

    // return [2, 6, 3, 5, 4, 1]
    var ret = game.math.shuffle([1, 2, 3, 4, 5, 6])

    // return [6, 1, 2, 4, 3, 5]
    var ret = game.math.shuffle([1, 2, 3, 4, 5, 6])