[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.4 LM:Randomize Sets

Before elements from an array may be selected from using the LM:Set Assign module (see section LM:Set Assign), the array needs to be randomized.

An array can be randomized either by elements or by pointers. Randomizing by elements actually moves each element of the array to a new location. It is like shuffling a deck of cards. Randomizing by pointers does not affect the array at all, but rather creates an internal list of the array's elements and randomizes that list. It is like creating a new batting line up for a baseball team. When an array is randomized by pointers, its elements are still accessible from their original positions by all Bunao modules. Only LM:Set Assign uses the new order when elements are drawn from the set.

A Bunao/Tcl array that has been randomized by pointers is often referred to as a set. Important: only a set (that is, an array randomized by pointers) can be used in the LM:Set Assign module.

Use the Sets listcontrol to create sets. Enter the source array in the Array field. Use the Rand By menubutton to select randomization by elements or pointers. The All items move checkbox can further require that after the randomization, no element is "accidentally" in the same place it was before.

LM:Randomize Sets user interface:

images/lm-randomize

LM:Randomize attribute list:
Attribute Type Default Description
sets.1 variable (blank) array name
sets.2 pointers
elements
`pointers' randomize by pointers or elements
sets.3 boolean `false' require that all items move



This document was generated on October, 28 2005 using texi2html