I have a project I am working on and I need something that will work in this scenario:
Say there are two teams, Team A and Team B. On Team A you have John, Rose, Dave, and Jade (made-up on the spot). On Team B is Jane, Roxy, Dirk, and Jake. I want to pick one person from each team, in a pair. Whatever I use to do this might pick Rose from Team A and Jake from Team B. They are a pair. And now, if I pick a random team again, it will not be able to give me either Rose or Jake in any combination (until started over in some way). I would also like to be able to pick how many pairs. There would be more than 4 choices on each list in the way I would use this.
So, the question is, is there any way to make something that would do this, and how?
If you're referring to programming, the concept is this:
You have a couple fixed string arrays (or string array and integer array for team allocation).
One method is that you also create an array or two of booleans the size of the two teams, initialised with zeroes / false;
then, the name selection function picks two random indices of players whose equivalent boolean value is false, prints them out, then sets their boolean value to true to avoid repicking. When the program is reset, the memory is wiped.
It's pretty inefficient with actual arrays as your data structure though, since you have to handle accidental selection of a 'true' player.
A better method would be this: No boolean array. Instead, integer array or two, which you fill with a random permutations - for example, 3|2|4|1 and 4|1|2|3 - and also a "pointer" integer initialised with 1;
in the name selection function, you print the strings corresponding to the permutation of the pointer (eg for pt = 1 -> t1 = 3, t2 = 4), then add 1 to the pointer. No fuss.