Remember two acts once

I wrote a software for randomly generating location points before.
I deliberately set the "random range to 0" to directly pass the value to avoid the calculation operation.
Later, because there will be repetitions of random numbers in the range, I will save the positions generated between List, check the newly generated position in the list first, if it has not been created before, otherwise return to a random position again.

……
As a result, when I set the random range to 0 today, the program will "not respond", and click again to "stuck".
After I keep recalling the previous process, the
logic forms an endless loop! ! !

Random range 0 = Same position = Except for the first one, there has always been that position generated in the lookup table --> Infinite loop! !

Guess you like

Origin blog.csdn.net/sinat_27382047/article/details/105983084