Ramsey's theorem: Difference between revisions

Content added Content deleted
Line 919: Line 919:
end
end
for i in nmin:nmax-1
for i in nmin:nmax-1
for n in 0:depth-1
for i in nmin:nmax-1
if a[idx[n + 1] + 1, i + 1] != typ
m = 0
break
for n in 0:depth-1
if a[idx[n + 1] + 1, i + 1] != typ
break
end
m = n +1
end
end
if n == depth
if m == depth
idx[n + 1] = i
idx[m + 1] = i
if findgroup(typ, 1, nmax, depth + 1)
if findgroup(typ, 1, nmax, depth + 1)
return true
return true
end
end
end
end
end
end
end
end
return false
return false
Line 982: Line 986:
All tests are OK.
All tests are OK.
</pre>
</pre>



=={{header|Kotlin}}==
=={{header|Kotlin}}==