code is this:
Long indx = getComboIndex(drawPosCombo,numsize,picksize); //[resolves to the value 1046]
Long cycles = 0l;
Long comboSize = getComboSize(numsize,picksize); //[resolves to the value 10626]
Long testIndex = ThreadLocalRandom.current().nextLong(0, comboSize);
while(testIndex != indx){
testIndex = ThreadLocalRandom.current().nextLong(0, comboSize);
cycles += 1;
}
I'm expecting this to run the while loop until I get a match between indx and testIndex and then continue on. But, it never leaves the loop :)
I dropped cycles in there to test how many attempts I had tried... after 21 Billion! attempts, it still cannot match the indx value of 1046 from the range of (0,10626). I stare at it and stare at it but my brain fails to see the issue.. please help :)
debugger shows that it faithfully is creating long values in range. It boggles my mind that a random generator would not match after this many tries.