I’m looking for a method to generate a invite code. I would prefer the code not looks like garbled text: JakSj12
But rather more like heroku, using a fun word with 3 numbers.
lightspeed131 or happy124, jetski99
How can I build a method that takes a list of words, maybe 100? and randomly assigns 3 numbers to them?
Thanks
Other answers given here are a bit slow, since they shuffle their lists on every call. Here’s something a bit faster:
This gives you three digits every time, if you want a number from 0 to 999 modify the rand() call accordingly.