RE: [Question] Randomizing captions
The random element will be easy to code: just multiply the result of Math.random() by the length of the array. As for enuring no duplicates, try this:
1. Make a copy of the array, prefereably as a list or set.
2. Select an item from the copy at random.
3. use item.
4. Delete selected item from copy.
5. Repeat from 2.
|