/I did a somewhat extensive search in the older topics about this question but I was unsuccessful, so if you know about a thread that is relevant, please share a link/
Brief version: How do you easily determine a random object out of an arbitrary number of objects (let's say 1-10)?
Longer version: It can not be done easily, but what would be the least difficult way?
The situation is simple:
I have a design that on occasion requires picking a random card from a varying number of cards. The complication is that the cards are placed on a board face up and all the cards will have different number of counters on them most of the time. Unfortunately this removes the only easy option of picking a random card - shuffle and draw.
Given that the number of cards is not constant, a dice roll is tricky to use. Basically the only way to pick a random-ish card without heavy supporting mechanic would be to close your eyes and stick your finger at the board. And this won't do (designer's decision :) ).
It looks like a problem without solution, so I guess my real question is - if you play a game that features a number of cards on the board, what way of determining a random one would annoy/tire you the least?
/not exactly perfectly working, that's why it's separated from the question/
One (a bit lame) way would be to have a dice, larger than the maximum number of cards that I would have to pick from. Then it's a matter of one or more rolls. Obviously this is not practical. It's like turning the car key several times until it starts, each time you want to start it up (you have 4 options and you roll 5, so you have to roll again).
Option 1
I was thinking about what kinds of semi-randomness I can have, given that I work with cards. The face up cards (the 'pool') are drown from a deck (size: currently undetermined, but let's say 50). If the deck is shuffled (as a general state throughout the game), it itself could be used as a randomization device. So may be each card could have a number on it (1..N) and I could draw a card from the deck and it's number will show me which card I've picked from my pool. At this point there are two problems - first, this is the same situation as with the dice roll, it's just less noisy :) Most importantly, if the pool contains two or more cards with the number X and I draw X from the deck, I still have to determine which of the pool cards with X is the picked one.
Going one step further could give me a kind of solution - each card in the deck has a number (1..N) and a color marker. When the cards are generated/created an effort is made for one number to be connected to one color as few times as possible. For a certain deck size you can even make sure every number/color combination exists only once in the deck.
And if the cards from the pool have any kind of order (first to last in the order they were placed, for example), you can pick the first card of that color that is lower or equal to the number of the draw (or just lower or equal if there is no such color in the pool).
Option 2
The 'monochrome' option would be to have two sets of numbers on the card - "X/Y", X and Y both being from 1 to N. Then you just have to make sure to "mix" the Xs and Ys well, when you combine them on the cards. What you do to determine a random card from the pool is just draw a card from the deck and look for the first occurrence of X OR Y in the pool. Makes sense?
Example:
- X and Y are from 1 to 7;
- In the pool you have (I almost randomly pounded the keyboard, the distribution is not correct, but imagine for a moment that it is):
6/7
4/7
1/5
2/1
3/3
4/2
- You draw a card with 1/6
- The "random" card from the pool is the first (6-7), since it is the first card from the pool that contains 1 OR 6
What do you say?
It's a bit of extra effort, but I think in the second case the number of mis-draws (draw from the deck, no X or Y in the pool) may not be so large.
The obvious drawback is that the last card could never be selected as a 'random' pick, because it has 4 and 2 and if you are looking for a 2 or 4 in the pool you will select either the second or the fourth card.
Any thoughts? This method could be modified and the noise in the system reduced more so may be it can be used somewhere.
P.S. On second thought - that drawback with the 'hidden' card could be employed as a feature. :) I'll try to develop this as a separate mechanic.