Isn't it ironic that many men spend a great part of their lives
avoiding marriage while single-mindedly pursuing those things that
would make them better prospects?
Today's fortuneIsn't it ironic that many men spend a great part of their lives
avoiding marriage while single-mindedly pursuing those things that would make them better prospects? User loginNavigation |
Mandelbrot in scheme, now in Block Structure™
#!/usr/bin/env guile
!#
(define (mandelbrot left right bottom top)
(define cols 78)
(define rows 39)
(define iter 36)
(define (density n)
(cond ((= n iter) #\ )
((and (>= n 0) (<= n 9)) (integer->char (+ n 48)))
((and (>= n 10) (<= n 36)) (integer->char (+ n 35 -10)))
(else #\.)))
(define (mandelbrot left right bottom top)
(do ((i 0 (1+ i))) ((>= i rows))
(do ((j 0 (1+ j))) ((>= j cols))
(let ((x (+ (* (/ j cols) (- right left)) left))
(y (+ (* (/ i rows) (- top bottom)) bottom)))
(write-char (density (let lp ((c (make-rectangular x y))
(z 0+0i)
(k 0))
(cond ((or (= k iter) (>= (magnitude z) 2)) k)
(else (lp c (+ (* z z) c) (1+ k )) )) ))) ))
(newline)))
(mandelbrot left right bottom top))
(mandelbrot -2 2 -2 2)
|
FriendsMainstream media |
Interesting article about
Thanks a lot for the
Alone with your custom term
Houses and cars are quite
please...help me to get
Thanks for the information
Post new comment