I have a list[] of items from which I'd like to display one randomly, but the displayed item must not repeat more than once in last x requests.
- list1 = item1, item2, item3, item4, item5, item6, item7, item8, item9, item 10
- Display a random selection from the list above
- list2 = store the last displayed item in list2 which should only store 7 items, not more
- Display a random selection from the list but make sure it doesn't exist in the list2
Is that the right way to do it? Either way, I'd like to know how to limit a list to store only 7 items?
Thanks