Re: [golf?] list of matches

2019-07-10 Thread Marc Chantreux
hello Bruce; > # Elegant using the "cat-ears" range modifiers in Perl 6: > for 0 ..^ @players.end -> \i { > for i ^.. @players.end -> \j { > say @players[i,j].join(' vs '); > } > } > # See https://docs.perl6.org/type/Range i played around it and got: my @players = ; my

Re: [golf?] list of matches

2019-07-10 Thread Bruce Gray
> On Jul 10, 2019, at 12:17 PM, Marc Chantreux wrote: —snip-- > my @rounds = >gather for ^@players -> \p > { take @players[p,$_] for p^..^@players }; Cool. Yet another way to do it: my @rounds = @players.kv.map: -> \k1, \p1 { |@players.skip(1 + k1).map: -> \p2