Random Object/Data Generator

Category:
Lists, Collections and Arrays
Type:
Applications
Difficulty:
Intermediate
Author:
Ethan

Version Compatibility: Visual Basic 6

More information:
Though the technique used in this example as a random number generator the code with little modification can be used for a variety of purposes:
  • Random object generator (pictures for games puzzles, cards etc)
  • Random name generator (Picking names for exchanging gifts)
  • Random file selector (graphic files in a directory for screensaver slide show)
  • Random number generator (Lotto numbers)
Basically it randomizes anything that can be stored in an array. The objects/data within the array are randomized through random selection of elements in the array

The code also illustrates numerous other useful techniques, which are documented in the comments.


Instructions: Click the link below to download the code. Select 'Save' from the IE popup dialog. Once downloaded, open the .zip file from your local drive using WinZip or a comparable program to view the contents.

Download rndmobjs.zip