gogole: unless someone changed something while I wasn’t looking, array.Length gives the number of elements in the array, not the index of the array. So, if an array has 3 elements, array.Length is 3, not 2. As written, Jeff’s “naive” code should run through:
rand.Next(3);
rand.Next(3);
rand.Next(3);
while the “non-naive” code should go through:
rand.Next(3);
rand.Next(2);