Access keys

Randomizer

Kind of class: class
Inherits from: none
Version: 1.00
Author: Jeroen Wijering
Classpath: com.jeroenwijering.utils.Randomizer
File last modified: Monday, 13 November 2006, 23:07:00
Pick random indexes out of an array, without having the same index picked multiple times.
Example:
import com.jeroenwijering.utils.Randomizer;
var myRandomizer = new Randomizer(myArray);
var myRandomIndex = myRandomizer.pick();

Summary

Constructor
Instance methods

Constructor

Randomizer

function Randomizer (
arr:Array)
Constructor
Parameters:
arr:
the array to pick random items from

Instance methods

pick

function pick (
) : Number
Randomly pick an index from the array given.
Returns:
The index that is randomly picked