itchboy Posted September 22, 2014 Report Share Posted September 22, 2014 Title says what I need help with. I want to create a random integer within a loop that does not repeat. So that means within a range of 4 for example, I would recieve only 0, 1, 2 or 3 in any order, but not two instances of the same number. The desired output would be this:3,1,2,0The number must not repeat at the next iteration of the loop either. I have tried using Math::rand%3 and adding a temp variable that checks the previous value of the random integer (during the previous loop interation) but it appears that the value of the temp value becomes garbage once the loop restarts itself.Can anyone help? Thanks! Quote Link to comment Share on other sites More sharing options...
Chris07 Posted September 23, 2014 Report Share Posted September 23, 2014 Do you need just 3 integers or do you need the ability to expand in definately? Quote Link to comment Share on other sites More sharing options...
itchboy Posted September 24, 2014 Author Report Share Posted September 24, 2014 The 3 integers was an example. I actually need 10 non repeating integers to be generated. That is all. Thanks Quote Link to comment Share on other sites More sharing options...