Exactly. I had to do this recently with a syllable generator for procedural names, it's much safer to run a fixed length pass over the things you're choosing from, removing the ones that have already been chosen, and then picking randomly from that list instead.
I will admit that OPs method was what first came to my mind when implementing it, though it never got past the "wait a minute... that's awful" phase of planning 🤣
2
u/Potential-Adagio-512 Apr 01 '22
can't you create an array of the items and remove items from the item pool once they're generated/collected?
1
u/seeroflights Mar 31 '22
Image Transcription: Code
I'm a human volunteer content transcriber and you could be too! If you'd like more information on what we do and why we do it, click here!