Barnsley fern: Difference between revisions
→{{header|Common Lisp}}
(Added Quackery.) |
Basicgames (talk | contribs) |
||
Line 735:
(multiple-value-setq (x y) (funcall (choose-transform) x y)))
(write-png-file filespec image)))</syntaxhighlight>
=={{header|Craft Basic}}==
<syntaxhighlight lang="basic">let x1 = 0
let y1 = 0
bgcolor 0, 0, 0
fgcolor 0, 255, 0
cls
label loop
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
gethdc
dot x1, y1
relhdc
let n = n + 1
wait
if n < 10000 then loop
print "done"</syntaxhighlight>
=={{header|D}}==
|