Working with random numbers
Posted on 2004-10-20
This may be a bit tricky; I’ll try to explain what I am trying to do and hope that there is a way to do it with some code I can use in VB.NET 2002. For this part of my program I need to take a number of known numbers then mix them with random numbers in a range to make a set of numbers in a specific format.
The number of known numbers is unknown: Example…there may be 1 known number, 3 known numbers or 10 known numbers…. I think something like having some type of input to add the known numbers to an array and then randomly pick the rest of the needed numbers from a range that the user sets and then randomly mix them all up and display them in a label or something best explains what it is I am looking for.
3 known numbers, needs to have total of 6 numbers, enter the 3 known numbers and they are added to an array, set the range of numbers 0 to 40 and have the program pick 3 numbers that are then added to the array, the numbers are randomly mixed together and then displayed in double digit format for numbers 0 to 9 so that 1 is 01 etc…. the label display might look like this: 08 – 25 – 14 – 07 – 06 – 34
Anyone have a working example of how this can be done?