summaryrefslogtreecommitdiff
path: root/tests/mandel.bth
blob: 43dc58b09864ffe51673fa49842f173de06576a0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
(set! pxy 0)
(while (< pxy 30)
    (set! cim (/ (- pxy 15) 15))
    (set! pxx 0)
    (while (< pxx 60)
           (set! cre (/ (- pxx 40) 20))
           (set! i 0)
           (set! zim cim)
           (set! zre cre)
           (while (< i 25)
                  (set! nzre (+ cre (- (* zre zre) (* zim zim))))
                  (set! nzim (+ cim (* 2 (* zre zim))))
                  (set! zre nzre)
                  (set! zim nzim)
                  (set! mag (+ (* zre zre) (* zim zim)))
                  (set! i (if (< mag 4) (+ i 1) 999)))
           (write (if (< mag 4) "#" "."))
           (set! pxx (+ pxx 1)))
    (say "")
    (set! pxy (+ pxy 1)))