, where he wants to generate a set of 1:1 meeting matchups within a list of people.
This link can't be embedded.
So basically:
Start with a list of names
Shuffle the list, so that we can randomly choose a 1:1 meeting partner for each person
Rules
People can’t meet with themselves
Everyone needs to be included, and no doubles (a fully random selection of people, calculated each row, would sometimes result in certain names appearing multiple times, and certain names not appearing at all)
Approach
We want to pull random pairs of names out of a hat until there are no more pairs left
Assign new random numbers to each Person each time a button is pressed (I made a
Grab pairs of people, and set them as each other’s match in the matchup column
Shuffle Matches
People
0
Person
Random Number
Last Modified
Matchup
Person
Random Number
Last Modified
Matchup
1
Alex Trebek
0.8242
44647.9962
Bob Barker
2
Bob Barker
0.6961
44647.9962
Alex Trebek
3
Charlie Rose
0.4561
44647.9962
Gene Rayburn
4
Drew Carey
0.5466
44647.9962
Fred Rogers
5
Ellen DeGeneres
0.9675
44647.9962
6
Fred Rogers
0.5741
44647.9962
Drew Carey
7
Gene Rayburn
0.2089
44647.9962
Charlie Rose
There are no rows in this table
Button Code
Comments ( // bla bla bla ) don’t work in Coda, but I’m including them here to try to explain things. If you want to copy-paste the code, it might be better to right-click on the button.
RunActions(
// Loop through the People table, working on each row one at a time
People.FormulaMap(
RunActions(
// Generate a random number for the random number column
ModifyRows(
CurrentValue, // CurrentValue means the current Person in the People table
[Random Number],
// For the seed, we're using the last modified date of the row, so that
// we get a fresh result each time we press the button; and also the ID
// of the row, so that we get a unique result for each row