Ramsey's theorem: Difference between revisions

Content added Content deleted
m (→‎{{header|Perl}}: Fix link: Perl 6 --> Raku)
m (→‎{{header|Ruby}}: Fix comment: Perl 6 --> Raku)
Line 1,483: Line 1,483:
end
end
a.each {|row| puts row.join(' ')}
a.each {|row| puts row.join(' ')}
# check taken from Perl6 version
# check taken from Raku version
(0...17).to_a.combination(4) do |quartet|
(0...17).to_a.combination(4) do |quartet|
links = quartet.combination(2).map{|i,j| a[i][j].to_i}.reduce(:+)
links = quartet.combination(2).map{|i,j| a[i][j].to_i}.reduce(:+)