Ramsey's theorem: Difference between revisions
m
→{{header|Perl 6}}: explicit .Array to allow iterating over 'combinations' output
SqrtNegInf (talk | contribs) m (→{{header|Perl 6}}: a 'flat' to restore correct operation) |
SqrtNegInf (talk | contribs) m (→{{header|Perl 6}}: explicit .Array to allow iterating over 'combinations' output) |
||
Line 550:
=={{header|Perl 6}}==
{{Works with|rakudo|
<lang perl6>my @a = [ 0 xx 17 ] xx 17;
@a[$_;$_] = '-' for ^17;
Line 560:
.say for @a;
for combinations(17,4).Array -> $quartet {
my $links = [+] $quartet.combinations(2).map: ->
die "Bogus!" unless 0 < $links < 6;
}
|