HP-85 – Barnsley Farn

Dieses Programm zeichnet einen Barnsley Farn auf dem HP-85 Computer.
Hier ist eine Variante für den DM42 Taschenrechner von SwissMicros.

Programm

100 ! Barnsley Fern
105 !
110 GRAPH @ GCLEAR
115 SCALE 0,255,0,191
120 !
125 DEF FNX1 = 0
130 DEF FNY1 = .16*Y
135 !
140 DEF FNX2 = .2*X-.26*Y
145 DEF FNY2 = .23*X+.22*Y+1.6
150 !
155 DEF FNX3 = -(.15*X)+.28*Y
160 DEF FNY3 = .26*X+.24*Y+.44
165 !
170 DEF FNX4 = .85*X+.04*Y
175 DEF FNY4 = -(.04*X)+.85*Y+1.6
180 !
200 X=0 @ Y=0 @ N=50000
205 FOR I=1 TO N
210 P=RND*100
215 IF P>15 THEN X1=FNX4 @ Y1=FNY4 @ GOTO 235
220 IF P>8 THEN X1=FNX3 @ Y1=FNY3 @ GOTO 235
225 IF P>1 THEN X1=FNX2 @ Y1=FNY2 @ GOTO 235
230 X1=FNX1 @ Y1=FNY1
235 X=X1 @ Y=Y1
240 U=51*(X+2.25) @ V=19*(Y+.05)
245 MOVE U,V @ PLOT U,V
250 NEXT I
255 END

Schreibe einen Kommentar

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert

This site uses Akismet to reduce spam. Learn how your comment data is processed.