Anthony Clarke

Anthony Clarke

  • NA
  • 127
  • 0

Make Random Numbers More Random - Thankyou

Dec 11 2010 5:09 PM

Hi,
Can you tell me how to make the numbers more random, it uses the same numbers in so many fields, i need them to be as different as possible essentially.
If you run this code you will see what i mean.
dataGridView2.ColumnCount = 4;
dataGridView2.Columns[0].Name =
"Column1";
dataGridView2.Columns[1].Name =
"Column2";
dataGridView2.Columns[2].Name =
"Column3";
dataGridView2.Columns[3].Name =
"Column4";
for (int i = 0; i < 100; i++)
{

Random t = new Random();


int get = t.Next(1, 1000);
int set = t.Next(1, 1000);
int ready = t.Next(1, 1000);
int go = t.Next(1, 1000);


dataGridView2.Rows.Add(get, set, ready, go);
 
Thanks
Anthony

Answers (7)