Here is my set up. In hockey, players form into "lines" which are on the ice at the same time. A "forward" line is a trio of Left Wing, Center and Right Wing. A "D" line is a pair of Left D and Right D. In beer leagues, you typically dress 13 skaters = 3 Forward lines, 2 D lines plus one Goalie.
Suppose I have 20 people who want to play. I want to construct the lines from 13 random skaters. I have to preserve their names and jersey numbers. I'm wondering if this is the job of Chapel Domains. For instance, something like
var player_ids: domain(1) = {1..20}
var jerseys [player_ids] = [71, 99, 97, ...]
var names [player_ids] = ['Alice', 'Bonobo', 'Changarakoo'...]
It's a simple idea, but now I want to
1. Pick three random players and assign them to Line 1 F
2. Pick three from the remainders and assign the to Line 2 F
...
n-1: Use the player ids to create an indicator matrix (details aren't important)
n: WIN!
The point of n-1 is that I have to be able to reference the player id and jersey number at the end.
What is the correct pattern for this in Chapel?