### Author Topic: Mandelbrot Set by qbguy  (Read 24433 times)

0 Members and 1 Guest are viewing this topic.

#### The Librarian

• Moderator
• Newbie
• Posts: 39
##### Mandelbrot Set by qbguy
« on: March 17, 2018, 09:43:35 am »
Mandelbrot Set

Author: @qbguy
Source: [abandoned, outdated and now likely malicious qb64 dot net website - don’t go there] Forum
URL: /forum/index.php?topic=121.0]http://www.[abandoned, outdated and now likely malicious qb64 dot net website - don’t go there]/forum/index.php?topic=121.0
Version: 2008
Tags: [2d], [fractal]

Description:
'public domain, uses qb64's 2d prototype

Source Code:
Code: QB64: [Select]
1. 'public domain
2. 'uses qb64's 2d prototype
3. DEFDBL A-Z
4. SCREEN _NEWIMAGE(640, 480, 32)
5. DIM R(15) AS INTEGER, G(15) AS INTEGER, B(15) AS INTEGER
6. FOR i = 0 TO 15: READ R(i): NEXT
7. FOR i = 0 TO 15: READ G(i): NEXT
8. FOR i = 0 TO 15: READ B(i): NEXT
9. DATA 0,63,63,63,63,63,31,0,0,31,31,31,47,63,63,63
10. DATA 0,0,15,31,47,63,63,63,63,31,15,0,0,0,0,0
11. DATA 0,0,0,0,0,0,0,0,31,63,63,63,63,63,42,21
12.
13. real = -2.2: imag = -1.2
14. incr = 0.005
15. FOR y = 0 TO 479
16.     r = real
17.     FOR x = 0 TO 639
18.         colour = (64 - mandel(r, imag, 64)) MOD 16
19.         colour = _RGB32(R(colour) * 4, G(colour) * 4, B(colour) * 4)
20.         PSET (x, y), colour
21.         r = r + incr
22.     imag = imag + incr
23.
24. FUNCTION mandel% (ox, oy, limit)
25.     x = ox: y = oy
26.     FOR c% = limit TO 1 STEP -1
27.         xx = x * x: yy = y * y
28.         IF xx + yy >= 4 THEN EXIT FOR
29.         y = x * y * 2 + oy
30.         x = xx - yy + ox
31.     mandel = c%
32.

« Last Edit: March 07, 2020, 04:58:10 am by Qwerkey »