Randomize Your Array Elements

Category:
Lists, Collections and Arrays
Type:
Snippets
Difficulty:
Intermediate
Author:
Anonymous

Version Compatibility: Visual Basic.NET

More information:
The following snippet of code is a method that takes an array as an argument, gets the length of the array, a random number, then for each item in the array swaps it with an item higher up in the index.

Instructions: Copy the declarations and code below and paste directly into your VB project.

Declarations:

Code: