Data update

This commit is contained in:
Ingy döt Net 2026-02-01 16:33:20 -08:00
parent 5150844a7d
commit 4bb20c9b71
7735 changed files with 38060 additions and 199180 deletions

View file

@ -1,29 +1,29 @@
MODULE Pythagoras_tree {
CLS 5, 0 ' MAGENTA, NO SPLIT SCREEN
PEN 14 ' YELLOW
\\ code from zkl/Free Basic
LET w = scale.x, h = w * 11 div 16
LET w2 = w div 2, diff = w div 12
LET TreeOrder = 6
pythagoras_tree(w2 - diff, h -10, w2 + diff, h -10, 0)
SUB pythagoras_tree(x1, y1, x2, y2, depth)
IF depth > TreeOrder THEN EXIT SUB
LOCAL dx = x2 - x1, dy = y1 - y2
LOCAL x3 = x2 - dy, y3 = y2 - dx
LOCAL x4 = x1 - dy, y4 = y1 - dx
LOCAL x5 = x4 + (dx - dy) / 2
LOCAL y5 = y4 - (dx + dy) / 2
MOVE x1, y1
DRAW TO x2, y2
DRAW TO x3, y3
DRAW TO x4, y4
DRAW TO x1, y1
pythagoras_tree(x4, y4, x5, y5, depth +1)
pythagoras_tree(x5, y5, x3, y3, depth +1)
END SUB
CLS 5, 0 ' MAGENTA, NO SPLIT SCREEN
PEN 14 ' YELLOW
\\ code from zkl/Free Basic
LET w = scale.x, h = w * 11 div 16
LET w2 = w div 2, diff = w div 12
LET TreeOrder = 6
pythagoras_tree(w2 - diff, h -10, w2 + diff, h -10, 0)
SUB pythagoras_tree(x1, y1, x2, y2, depth)
IF depth > TreeOrder THEN EXIT SUB
LOCAL dx = x2 - x1, dy = y1 - y2
LOCAL x3 = x2 - dy, y3 = y2 - dx
LOCAL x4 = x1 - dy, y4 = y1 - dx
LOCAL x5 = x4 + (dx - dy) / 2
LOCAL y5 = y4 - (dx + dy) / 2
MOVE x1, y1
DRAW TO x2, y2
DRAW TO x3, y3
DRAW TO x4, y4
DRAW TO x1, y1
pythagoras_tree(x4, y4, x5, y5, depth +1)
pythagoras_tree(x5, y5, x3, y3, depth +1)
END SUB
}
Pythagoras_tree

View file

@ -1,44 +1,44 @@
MODULE Pythagoras_Example{
CLS 5, 0 ' MAGENTA, split line = 0
PEN 14 ' YELLOW
\\ Linux smoothing not work (we can use the statement but without effect)
IF ISWINE ELSE SMOOTH ON
\\ PYTHAGORAS TREE
\\ by definition all variables ar type of a double
GLOBAL p=7, p4=PI/4, p2=PI/2, s2=SQRT(2)/2
MODULE center_p (r, t){
MODULE pythagoras_tree (r, dx, depth) {
r2=r-p2
DRAW ANGLE r, dx
DRAW ANGLE r2, dx
DRAW ANGLE r, -dx
DRAW ANGLE r2, -dx
IF depth>10 THEN EXIT
s3=dx*s2
depth++
STEP ANGLE r+p4, s3*2
CALL pythagoras_tree r-p4, s3, depth
STEP ANGLE r, -dx-s3
STEP ANGLE r, s3
STEP ANGLE r+p4, -s3
CALL pythagoras_tree r+p4, s3, depth
STEP ANGLE r-p4, s3
}
MOVE SCALE.X/2, SCALE.Y/2
STEP ANGLE PI-p4+r, t*s2
CALL pythagoras_tree r, t, 1
}
r=PI/3
pixels=100
center_p r, 100*TWIPSX
center_p r+PI, 100*TWIPSX
CopyImageToClipboard()
Sub CopyImageToClipboard()
LOCAL Scr$=""
MOVE 0,0
COPY SCALE.X, SCALE.Y TO Scr$
CLIPBOARD Scr$
END SUB
CLS 5, 0 ' MAGENTA, split line = 0
PEN 14 ' YELLOW
\\ Linux smoothing not work (we can use the statement but without effect)
IF ISWINE ELSE SMOOTH ON
\\ PYTHAGORAS TREE
\\ by definition all variables ar type of a double
GLOBAL p=7, p4=PI/4, p2=PI/2, s2=SQRT(2)/2
MODULE center_p (r, t){
MODULE pythagoras_tree (r, dx, depth) {
r2=r-p2
DRAW ANGLE r, dx
DRAW ANGLE r2, dx
DRAW ANGLE r, -dx
DRAW ANGLE r2, -dx
IF depth>10 THEN EXIT
s3=dx*s2
depth++
STEP ANGLE r+p4, s3*2
CALL pythagoras_tree r-p4, s3, depth
STEP ANGLE r, -dx-s3
STEP ANGLE r, s3
STEP ANGLE r+p4, -s3
CALL pythagoras_tree r+p4, s3, depth
STEP ANGLE r-p4, s3
}
MOVE SCALE.X/2, SCALE.Y/2
STEP ANGLE PI-p4+r, t*s2
CALL pythagoras_tree r, t, 1
}
r=PI/3
pixels=100
center_p r, 100*TWIPSX
center_p r+PI, 100*TWIPSX
CopyImageToClipboard()
Sub CopyImageToClipboard()
LOCAL Scr$=""
MOVE 0,0
COPY SCALE.X, SCALE.Y TO Scr$
CLIPBOARD Scr$
END SUB
}
Pythagoras_Example