Skip to main content

All Questions

Tagged with
Filter by
Sorted by
Tagged with
0 votes
3 answers
1k views

How to guarantee an ID is unique in a non-UUID set of values?

I would like to have IDs of different sizes from the alphabet 0-9. So I have 5-length IDs as in 10000 or 13531, etc.. I have 10, 15, 20, up to 39 digit strings (the size of a UUID). I would like to ...
Lance Pollard's user avatar
4 votes
3 answers
11k views

Best way to choose random element from weighted list

I want to create a simple game. Every so often, a power up should appear. Right now the different kinds of power ups are stored in an array. However, not every power up should appear equally often: ...
Qqwy's user avatar
  • 4,917