std-randomize


Synopsis

(std-randomize <list>)

Description

Shuffles a list randomly. Returns a copy of the randomized list consisting

of the same, = but not EQ, elements of the original list in random order.

Note

This operation is usually quite costly in plain AutoLISP, especially on large lists.

For VL there exists therefore an improved version (std-%randomize [random-state]) from FILEEXT.FAS

Example

(std-randomize '(0 1 2 3 4))
e.g. might return: => (3 1 4 0 2)
or: => (4 1 2 0 3)

Arguments

list: any list (not proper lists also?)

Return Value

Returns a copy of the list with the same elements but in random order.

Side Effects

None.

Module

(std-require 'STDLIST)

Defined in STDLIST and extended for VL in FILEEXT.FAS