Jump to content

Cantor set: Difference between revisions

no edit summary
No edit summary
No edit summary
Line 897:
"███ ███ ███ ███ ███ ███ ███ ███",
"█ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █"]</pre>
 
=={{header|EMal}}==
<syntaxhighlight lang="emal">
int WIDTH = 81
int HEIGHT = 5
fun cantor = void by int start, int len, int index
int seg = len / 3
if seg == 0 do return end
for int i = index; i < HEIGHT; i++
for int j = start + seg; j < start + seg * 2; j++
lines[i][j] = " "
end
end
cantor(start, seg, index + 1)
cantor(start + seg * 2, seg, index + 1)
end
List lines = text[].with(HEIGHT) # a list with HEIGHT empty texts
for each int i in range(0, HEIGHT) do lines[i] = text("█", WIDTH) end
cantor(0, WIDTH, 1)
for each text line in lines do writeLine(line) end
</syntaxhighlight>
 
=={{header|Excel}}==
226

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.