Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
31
Task/Fractal-tree/ZX-Spectrum-Basic/fractal-tree.basic
Normal file
31
Task/Fractal-tree/ZX-Spectrum-Basic/fractal-tree.basic
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
10 LET level=12: LET long=45
|
||||
20 LET x=127: LET y=0
|
||||
30 LET rotation=PI/2
|
||||
40 LET a1=PI/9: LET a2=PI/9
|
||||
50 LET c1=0.75: LET c2=0.75
|
||||
60 DIM x(level): DIM y(level)
|
||||
70 BORDER 0: PAPER 0: INK 4: CLS
|
||||
80 GO SUB 100
|
||||
90 STOP
|
||||
100 REM Tree
|
||||
110 LET x(level)=x: LET y(level)=y
|
||||
120 GO SUB 1000
|
||||
130 IF level=1 THEN GO TO 240
|
||||
140 LET level=level-1
|
||||
150 LET long=long*c1
|
||||
160 LET rotation=rotation-a1
|
||||
170 GO SUB 100
|
||||
180 LET long=long/c1*c2
|
||||
190 LET rotation=rotation+a1+a2
|
||||
200 GO SUB 100
|
||||
210 LET rotation=rotation-a2
|
||||
220 LET long=long/c2
|
||||
230 LET level=level+1
|
||||
240 LET x=x(level): LET y=y(level)
|
||||
250 RETURN
|
||||
1000 REM Draw
|
||||
1010 LET yn=-SIN rotation*long+y
|
||||
1020 LET xn=COS rotation*long+x
|
||||
1030 PLOT x,y: DRAW xn-x,y-yn
|
||||
1040 LET x=xn: LET y=yn
|
||||
1050 RETURN
|
||||
Loading…
Add table
Add a link
Reference in a new issue