Data update

This commit is contained in:
Ingy döt Net 2023-12-16 21:33:55 -08:00
parent 35bcdeebf8
commit 74c69a0df6
2427 changed files with 31826 additions and 3468 deletions

View file

@ -0,0 +1,31 @@
on SierpinskiCarpet(n, char)
if (n < 0) then return {}
script o
property lst1 : {char}
property lst2 : missing value
end script
set gap to space
repeat with k from 0 to (n - 1)
copy o's lst1 to o's lst2
repeat with i from 1 to (3 ^ k)
set str to o's lst1's item i
set o's lst1's item i to str & str & str
set o's lst2's item i to str & gap & str
end repeat
set o's lst1 to o's lst1 & o's lst2 & o's lst1
set gap to gap & gap & gap
end repeat
return join(o's lst1, linefeed)
end SierpinskiCarpet
on join(lst, delim)
set astid to AppleScript's text item delimiters
set AppleScript's text item delimiters to delim
set txt to lst as text
set AppleScript's text item delimiters to astid
return txt
end join
return SierpinskiCarpet(3, "#")

View file

@ -0,0 +1,15 @@
100 PROGRAM "Sierpins.bas"
110 LET O=3
120 LET SZ=3^O
130 FOR Y=0 TO SZ-1
140 FOR X=0 TO SZ-1
150 LET CH$=CHR$(159)
160 LET X1=X:LET Y1=Y
170 DO UNTIL X1=0
180 IF MOD(X1,3)=1 AND MOD(Y1,3)=1 THEN LET CH$=" ":EXIT DO
190 LET X1=INT(X1/3):LET Y1=INT(Y1/3)
200 LOOP
210 PRINT CH$;
220 NEXT
230 PRINT
240 NEXT