cl-rw

Layered streams for Common Lisp
git clone https://logand.com/git/cl-rw.git/
Log | Files | Refs

commit ea8b8b0f7a9bb637befd6445922b6a54a170278b
parent 9c4d267738543fd7e4ab4b4aad906b17b0a43e26
Author: Tomas Hlavaty <tom@logand.com>
Date:   Sun, 20 Sep 2015 18:50:04 +0200

try mandelbrot on linux console

Diffstat:
Mfb.lisp | 23+++++++++++++++++++++++
1 file changed, 23 insertions(+), 0 deletions(-)

diff --git a/fb.lisp b/fb.lisp @@ -180,6 +180,28 @@ (setq *x* x1 *y* y1) (lineto x2 y2))) + (:mandelbrot + (let ((x1 -2) + (y1 -1.5) + (x2 1) + (y2 1.5) + (w 100) + (h 100)) + (dotimes (y h) + (dotimes (x w) + (loop + with a = (complex + (float (+ (* (/ (- x2 x1) w) x) x1)) + (float (+ (* (/ (- y2 y1) h) y) y1))) + for z = a then (+ (* z z) a) + while (< (abs z) 2) + for c from 60 above 0 + finally (pixel x + (+ 300 y) + 255 + (mod (* 13 c) 256) + (mod (* 7 c) 256) + (mod (* 2 c) 256))))))) (:p (mapc #'rec b)) (:polyline @@ -230,6 +252,7 @@ (funcall fb '(:html (:body + (:mandelbrot) (:h1 "Heading 1") (:h2 "Heading 2") (:h3 "Heading 3")