Click here to Skip to main content
15,902,492 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Accessing a database on a network drive Pin
Dave Kreskowiak7-May-04 9:52
mveDave Kreskowiak7-May-04 9:52 
GeneralRandom Number Generator Pin
Britnt77-May-04 3:31
Britnt77-May-04 3:31 
GeneralRe: Random Number Generator Pin
Colin Angus Mackay7-May-04 3:59
Colin Angus Mackay7-May-04 3:59 
GeneralRe: Random Number Generator Pin
Britnt77-May-04 4:51
Britnt77-May-04 4:51 
GeneralRe: Random Number Generator Pin
Colin Angus Mackay7-May-04 5:02
Colin Angus Mackay7-May-04 5:02 
GeneralRe: Random Number Generator Pin
Britnt77-May-04 5:29
Britnt77-May-04 5:29 
GeneralRe: Random Number Generator Pin
Colin Angus Mackay7-May-04 12:08
Colin Angus Mackay7-May-04 12:08 
GeneralRe: Random Number Generator Pin
Britnt712-May-04 2:29
Britnt712-May-04 2:29 
Yes! There was one problem in your code. When I was debugging through your code, I had to change one line:
PossibleValues.RemoveAt(Counter)
This removes the Counter from the arraylist which in fact it should remove the number that was chosen for the new array from the arraylist. I did this by:
PossibleValues.RemoveAt(Index)
This solves the problem.

It is definetly good enough for me but I was trying to do the impossible. This was my vision as to what should happen.

You have 5 numbers (1,2,3,4,5)
Randomly select a number from those five
Lets say 3 - now the numbers left are (1,2,4,5)
Randomly select a number from those four
Lets say 4 - now the numbers left are (1,2,5)
Randomly select a number from those three
Lets say 2 - now the numbers left are (1,5)

Your array is (3,4,2)

Your code above does this but the random number selected is an index and not the true number. In your case, if the number chosen is a 4 then index = 4 and the number would be 5.

Now the array above has changed to (3,4,5)

I think this is impossible to mimick a true say lottery drawing.

Thanks for all of your help.;)
GeneralRe: Random Number Generator Pin
Nick Seng12-May-04 0:02
Nick Seng12-May-04 0:02 
GeneralRe: Random Number Generator Pin
Britnt712-May-04 2:38
Britnt712-May-04 2:38 
GeneralRe: Random Number Generator Pin
Britnt712-May-04 3:23
Britnt712-May-04 3:23 
GeneralVB.NET Forms and Painting Pin
opopov6-May-04 22:08
opopov6-May-04 22:08 
GeneralRe: VB.NET Forms and Painting Pin
Syed Abdul Khader7-May-04 0:45
Syed Abdul Khader7-May-04 0:45 
GeneralRe: VB.NET Forms and Painting Pin
opopov7-May-04 5:29
opopov7-May-04 5:29 
GeneralRe: VB.NET Forms and Painting Pin
Syed Abdul Khader10-May-04 21:11
Syed Abdul Khader10-May-04 21:11 
Generalslideshow app in vb6 Pin
Ashwin C6-May-04 9:07
Ashwin C6-May-04 9:07 
GeneralRe: slideshow app in vb6 Pin
Dave Kreskowiak7-May-04 10:06
mveDave Kreskowiak7-May-04 10:06 
GeneralCom based add-in office Pin
skoizumi291106-May-04 6:01
sussskoizumi291106-May-04 6:01 
GeneralFrom C# to VB.Net Pin
Clandestine6-May-04 5:32
Clandestine6-May-04 5:32 
GeneralRe: From C# to VB.Net Pin
Dave Kreskowiak6-May-04 6:18
mveDave Kreskowiak6-May-04 6:18 
GeneralRe: From C# to VB.Net Pin
Clandestine7-May-04 3:30
Clandestine7-May-04 3:30 
GeneralVB6 Console APP Pin
gasma19755-May-04 14:42
gasma19755-May-04 14:42 
GeneralRe: VB6 Console APP Pin
Dave Kreskowiak5-May-04 15:04
mveDave Kreskowiak5-May-04 15:04 
GeneralRe: VB6 Console APP Pin
gasma19756-May-04 7:47
gasma19756-May-04 7:47 
GeneralRe: VB6 Console APP Pin
Dave Kreskowiak6-May-04 8:55
mveDave Kreskowiak6-May-04 8:55 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.