cloudspace / university-randomizer

1 stars 4 forks source link

Changing to a smaller range will result in no items being generated. #5

Open iargue opened 9 years ago

iargue commented 9 years ago

If you start out with a specific range size (10-20 for 10 total numbers) and then generate a few (say 5) random numbers, and then change the range, if the new range is 5 or less, the program will fail to generate any new numbers.

This occurs even if the range is separate from the previous range (Aka, doing range 10-20 and then 30-35). This is caused because the code simply checks if the number of previously picked items are greater then the range, instead of validating it.