Data update
This commit is contained in:
parent
35bcdeebf8
commit
74c69a0df6
2427 changed files with 31826 additions and 3468 deletions
21
Task/Cantor-set/MiniScript/cantor-set.mini
Normal file
21
Task/Cantor-set/MiniScript/cantor-set.mini
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
cantorSet = function(start, length, depth)
|
||||
if depth == 0 then return [[start, start+length - 1]]
|
||||
|
||||
newLen = length / 3
|
||||
|
||||
leftInterval = cantorSet(start, newLen, depth - 1)
|
||||
rightInterval = cantorSet(start + 2 * newLen, newLen, depth - 1)
|
||||
|
||||
return leftInterval + rightInterval
|
||||
end function
|
||||
|
||||
for depth in range(0, 4)
|
||||
output =[" "] * 81
|
||||
segments = cantorSet(1, 81,depth)
|
||||
for segment in segments
|
||||
for x in range(segment[0] - 1, segment[1]-1)
|
||||
output[x] = "#"
|
||||
end for
|
||||
end for
|
||||
print output.join("")
|
||||
end for
|
||||
Loading…
Add table
Add a link
Reference in a new issue