RosettaCodeData/Task/Barnsley-fern/Craft-Basic/barnsley-fern.basic
2023-07-01 13:44:08 -04:00

43 lines
527 B
Text

define x1 = 0, y1 = 0
bgcolor 0, 0, 0
cls graphics
for i = 1 to 10000
let r = rnd
if r > 0 and r < .01 then
let x = .0
let y = .16 * y
endif
if r > .01 and r < .08 then
let x = .22 * x - .26 * y
let y = -.23 * x + .22 * y + 1.6
endif
if r > .075 and r < .15 then
let x = .15 * x + .28 * y
let y = -.29 * x + .24 * y + .44
endif
let x = .85 * x + .04 * y
let y = -.04 * x + .85 * y + 1.6
let x1 = (x + 3) * 70
let y1 = 700 - y * 70
fgcolor 0, int(rnd * 255), 0
dot x1, y1
wait
next i