How To Program "Barnsley Fern" in BASIC | Commodore Plus/4, 64, 128 | Codereview

Описание к видео How To Program "Barnsley Fern" in BASIC | Commodore Plus/4, 64, 128 | Codereview

"Barnsley Fern" (Fractal)
A small codereview of this small Commodore 3.5 BASIC Program for the Commodore 16, 116 and Plus/4. Compatible with BASIC 7.0 for the Commodore 128

For the Commodore 64 try this BASIC 3.5 extension:
Link: https://csdb.dk/release/?id=189017

Wikipedia "Barnsley Fern":
https://en.wikipedia.org/wiki/Barnsle...

Code
(Replace {less} with the mathematical "less" symbol)
new
5 REM BARNSLEY FERN
10 YY(1)=.16
20 XX(2)=.85:XY(2)=.04:YX(2)=-.04:YY(2)=.85:Y(2) = 1.6
30 XX(3)=.20:XY(3)=-.26:YX(3)=.23:YY(3)=.22:Y(3) = 1.6
40 XX(4)=-.15:XY(4)=.28:YX(4)=.26:YY(4)=.24:Y(4) = .44
50 color4,1:color0,1:color1,6,4
55 graphic1,1
60 X=0:Y=0
70 FOR I = 1 TO 7500
80 R = INT(RND (1) * 100)
90 IF R {Less} 1 then F=1:ELSEIF R {less] 86 then F=2:ELSEIF R {less} 93 then F=3:ELSE F=4
100 X = XX(F) * X + XY(F) * Y
110 Y = YX(F) * X + YY(F) * Y
120 Y = Y + Y(F)
130 X% = 151 + X * 29.9
140 Y% = 200 - Y * 19.1:Color1,F+4,6
150 draw, X%,Y%
160 NEXT
170 GETKEY K$:GRAPHIC 0
run

#barnsley #fern #barnsleyfern #fractal #basic #commodore #retro #programming #C16 #plus4 #c116 #c64 #Apple #Atari #Amiga

Комментарии

Информация по комментариям в разработке