Jump to content

Julia set: Difference between revisions

→‎{{header|BASIC}}: add Locomotive Basic version
m (→‎{{header|Phix}}: IupDestroy is now a function)
(→‎{{header|BASIC}}: add Locomotive Basic version)
Line 226:
 
=={{header|BASIC}}==
 
==={{header|Locomotive Basic}}===
 
Adapted from the Mandelbrot Locomotive Basic program. This program is meant for use in [https://benchmarko.github.io/CPCBasic/cpcbasic.html CPCBasic] specifically, where it draws a 16-color 640x400 image in less than a minute. (Real CPC hardware would take far longer than that and has lower resolution.)
<lang locobasic>1 MODE 3 ' Note the CPCBasic-only screen mode!
2 FOR xp = 0 TO 639
3 FOR yp = 0 TO 399
4 x0 = -0.512511498387847167 : y0 = 0.521295573094847167
5 x = xp / 213 - 1.5 : y = yp / 200 - 1
6 iteration = 0
7 maxIteration = 100
8 WHILE (x * x + y * y <= (2 * 2) AND iteration < maxIteration)
9 xtemp = x * x - y * y + x0
10 y = 2 * x * y + y0
11 x = xtemp
12 iteration = iteration + 1
13 WEND
14 IF iteration <> maxIteration THEN c = iteration ELSE c = 0
15 PLOT xp, yp, c MOD 16
16 NEXT
17 NEXT</lang>
 
==={{header|Sinclair ZX81 BASIC}}===
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.