vb.net - Why are all of my Random variables the same (Visual Basic)? -


This code is trying to use multiple random variables for what I am creating in Visual Studio.

  The Private sub button handles 1_Click (as the sender object, and EventArgs) button 1. Click 'New Random Dim CC 5 as new random slow CC 3 as new random slow cc2 as new random slow cc1 new random blur cc1 new random silk cc1 as new random cc1 = Cc1.ext (1, 14) Dimensional cCard2 as new integer cCard2 = CC2. New integer cCard4 = cC4 as the new integer cCard3 = cC3.ext (1, 14) dim cCard4 as the next (1, 14) dim cCard3. New integer dimension in the form of a new integer cCard5 = cc5.ext (1, 14) 'computer random option dim x as the next (1, 14) dim cCard5 new Random x = S.Next (1, 14)   

is slightly more but it is basically a duplicate. The problem is that these "random" variables are all the same, I thought the error might have been because the code was:

dim cCard1 = cc1. Next (1, 14)

I have written another program which I wanted with the exact same code, while the program variables are not all very random: (

it After switching to the current code, this issue is still prominent and I am looking for an explanation about why this is so, and more importantly, one way to correct this error would be greatly appreciated! < / P>

The reason for this is That's when you make a random example, it uses the present time because it happens in the form of a seed. Seed is a number, when equally, the exact sequence of pseudorandom numbers is generated. It is very fast in your case that all the examples share the same seeds and thus all yield

should make you an a random example And instead it should get many numbers.

Comments

Popular posts from this blog

Java - Error: no suitable method found for add(int, java.lang.String) -

java - JPA TypedQuery: Parameter value element did not match expected type -

c++ - static template member variable has internal linkage but is not defined -