Ramsey's theorem: Difference between revisions
m
→{{header|Perl 6}}: .Array work-around now obsolete, factored out array-size constant
SqrtNegInf (talk | contribs) (Added Perl example) |
SqrtNegInf (talk | contribs) m (→{{header|Perl 6}}: .Array work-around now obsolete, factored out array-size constant) |
||
Line 946:
=={{header|Perl 6}}==
{{Works with|rakudo|
<lang perl6>my
my @a
@a[$_;$_] = '-' for ^$n;
for flat ^
my $j = ($i + $k) %
@a[$i;$j] = @a[$j;$i] = 1;
}
.say for @a;
for combinations(
my $links = [+] $quartet.combinations(2).map: -> $i,$j { @a[$i;$j] }
die "Bogus!" unless 0 < $links < 6;
|