Oh... hmmm! That's done on Pokéfarm, too...
So let's see... three eggs, when one is taken three things should be done:
- See if that egg is still available (by checking against timestamp), if true, continue.
- Store a 'claimed' timestamp when the egg is successfully picked up.
- Reshuffle the eggs (include the two unclaimed and add a random third).
The three random eggs are shuffled server-side and stored in the database. When the page loads, it'll access the database and pull up the shuffled set of eggs with the most recent 'creation' timestamp. The data will also be stored with a 'claimed' timestamp, which will be filled moments before a new row is created upon a new shuffle.
Two other things to consider:
We don't want to store an infinite number of shuffled egg sets in the database, so to save on database space will will also look for the row with the oldest 'claimed' timestamp and remove it while creating a new one.
We also don't necessary want eggs to stagnate. Considerations will have to be made about that. Ordinarily we'd want the two eggs that weren't claimed to stay there for the next refresh... but what if we want to force these eggs to change? I think a good time to do this would be test how long it's been since that egg set was created. If it took more than an hour for one of the three to be claimed, randomize all three eggs going into the next draw.
Is this all heading in the right direction?