Post by David Drake on Feb 18, 2020 11:34:19 GMT -5
I created the code below for the Barnsley Fern task on Rosetta Code (rosettacode.org/wiki/Barnsley_fern). The task is described at the top of the page. I adapted already posted code for IS-BASIC. Please post comments or suggestions.
nomainwin WindowWidth=800 WindowHeight=600
open "Barnsley Fern" for graphics_nf_nsb as #1 #1 "trapclose [q];down;fill black;flush;color green"
for n = 1 To WindowHeight * 50 r = int(rnd(1)*100) Select Case Case (r>=0) and (r<=84) xn=0.85*x+0.04*y yn=-0.04*x+0.85*y+1.6 Case (r>84) and (r<=91) xn=0.2*x-0.26*y yn=0.23*x+0.22*y+1.6 Case (r>91) and (r<=98) xn=-0.15*x+0.28*y yn=0.26*x+0.24*y+0.44 Case Else xn=0 yn=0.16*y End Select