Data update
This commit is contained in:
parent
8f05c7136f
commit
0bf4da02c3
82 changed files with 2194 additions and 118 deletions
35
Task/Dragon-curve/ANSI-BASIC/dragon-curve.basic
Normal file
35
Task/Dragon-curve/ANSI-BASIC/dragon-curve.basic
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
100 PROGRAM DragonCurve
|
||||
110 DECLARE SUB Dragon
|
||||
120 SET WINDOW 0, 639, 0, 399
|
||||
130 SET AREA COLOR 1
|
||||
140 SET COLOR MIX(1) 0, 0, 0
|
||||
150 REM SIN, COS in arrays for PI/4 multipl.
|
||||
160 DIM S(0 TO 7), C(0 TO 7)
|
||||
170 LET QPI = PI / 4
|
||||
180 FOR I = 0 TO 7
|
||||
190 LET S(I) = SIN(I * QPI)
|
||||
200 LET C(I) = COS(I * QPI)
|
||||
210 NEXT I
|
||||
220 REM ** Initialize variables non-local for SUB Dragon.
|
||||
230 LET SQ = SQR(2)
|
||||
240 LET X = 224
|
||||
250 LET Y = 140
|
||||
260 LET RotQPi = 0
|
||||
270 CALL Dragon(256, 15, 1) ! Insize = 2^WHOLE_NUM (looks better)
|
||||
280 REM ** Subprogram
|
||||
290 SUB Dragon (Insize, Level, RQ)
|
||||
300 IF Level <= 1 THEN
|
||||
310 LET XN = C(RotQPi) * Insize + X
|
||||
320 LET YN = S(RotQPi) * Insize + Y
|
||||
330 PLOT LINES: X, 399 - Y; XN, 399 - YN
|
||||
340 LET X = XN
|
||||
350 LET Y = YN
|
||||
360 ELSE
|
||||
370 LET RotQPi = MOD((RotQPi + RQ), 8)
|
||||
380 CALL Dragon(Insize / SQ, Level - 1, 1)
|
||||
390 LET RotQPi = MOD((RotQPi - RQ * 2), 8)
|
||||
400 CALL Dragon(Insize / SQ, Level - 1, -1)
|
||||
410 LET RotQPi = MOD((RotQPi + RQ), 8)
|
||||
420 END IF
|
||||
430 END SUB
|
||||
440 END
|
||||
Loading…
Add table
Add a link
Reference in a new issue