Design Scripting Documentation
     
 
     
  Array Shuffle  
     
     
  Inputs:  
     
an array
     
  Outputs:  
     
the array shuffled
     
  Implementation
01  function array_shuffle( array_object )
02    randomize
03    dim index
04    for index = lbound( array_object ) to ubound( array_object )
05      dim random: random = int( rnd( ) * ubound( array_object ) )
06      dim temp: temp = array_object( index )
07      array_object( index ) = array_object( random )
08      array_object( random ) = temp
09    next
10  end function
 
     

Creative Commons License
The Design Scripting Library, including its sources, online documentation and graphics, are licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 2.5 License.

Online Documentation generated by { vbdoclib } version 1.0
Color-Coding generated by { vbcc } version 2.0
Page timestamp: { Feb. 2, 2006 }





 
     
     
 
Documentation
Cover Page
Expand
Collapse
 
Array
 
Bitmap File
 
Bounding Box
 
Color
 
Container
 
Doclet
 
Ellipse
 
Intersection
 
Language
 
Map
 
Matrix
 
Number
 
Nurbs
 
Range
 
STL File
 
Streams
 
String
 
Surface
 
Text File
 
Triangle
 
Vector
 
Vertex
 
Wave File