O.P. Random numbers, prevent from being used more than once
Ok, so I got bored today and was thinking what else I could add to a script that I have been working on that displays a random lyric. What I want to do, is make it so that the random number that is generated is not repeated within a certain amount of number generations. So for example, the numer 7 is generated, and then that number cant be used again until 10 different numbers have been used. Something like that.
What I am looking for are ideas to do that.. I looked online, and all I could find was ways to prevent using the same number twice in a row.. But I am looking for a way to prevent the same lyric being used until, lets say 10, different lyrics have been used. I dont like using the same lyric every other or every 4 times or something, and that has happened.
Anyways, does anyone have any ideas how to go about doing this? I was thinking of storing the random number into an array and then comparing the new random number against the array to make sure they are different.. but I couldnt find any way to make that work. Any new ideas or help would be great, thanks
|