Data update
This commit is contained in:
parent
81fd053722
commit
52a6ef48dd
10248 changed files with 63654 additions and 6775 deletions
|
|
@ -5,10 +5,10 @@ BEGIN
|
|||
# divisible by 3 ( except for the final line where the segment width will #
|
||||
# be 1 ) #
|
||||
INT set width = 3 ^ ( lines - 1 );
|
||||
[ set width ]CHAR set;
|
||||
[ set width ]CHAR cset;
|
||||
# start with a complete line #
|
||||
FOR i TO set width DO set[ i ] := "#" OD;
|
||||
print( ( set, newline ) );
|
||||
FOR i TO set width DO cset[ i ] := "#" OD;
|
||||
print( ( cset, newline ) );
|
||||
# repeatedly modify the line, replacing the middle third of each segment #
|
||||
# with blanks #
|
||||
INT segment width := set width OVER 3;
|
||||
|
|
@ -17,11 +17,11 @@ BEGIN
|
|||
WHILE set pos < ( set width - segment width ) DO
|
||||
set pos +:= segment width;
|
||||
FOR char pos FROM set pos TO ( set pos + segment width ) - 1 DO
|
||||
set[ char pos ] := " "
|
||||
cset[ char pos ] := " "
|
||||
OD;
|
||||
set pos +:= segment width
|
||||
OD;
|
||||
print( ( set, newline ) );
|
||||
print( ( cset, newline ) );
|
||||
segment width OVERAB 3
|
||||
OD
|
||||
END
|
||||
|
|
|
|||
|
|
@ -1,17 +1,16 @@
|
|||
int WIDTH = 81
|
||||
int HEIGHT = 5
|
||||
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
|
||||
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] = " "
|
||||
int WIDTH ← 81
|
||||
int HEIGHT ← 5
|
||||
List lines = text[].with(HEIGHT, <int value|text("█", WIDTH))
|
||||
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
|
||||
cantor(0, WIDTH, 1)
|
||||
for each text line in lines do writeLine(line) end
|
||||
lines.list(<text line|writeLine(line))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue