Mandelbrot for the terminal
From: Frank Buss (fb_at_frank-buss.de)
Date: 07/30/04
- Next message: Edi Weitz: "Re: Mandelbrot for the terminal"
- Previous message: Rainer Joswig: "Re: Smaltalk, modify code on the fly..."
- Next in thread: Edi Weitz: "Re: Mandelbrot for the terminal"
- Reply: Edi Weitz: "Re: Mandelbrot for the terminal"
- Reply: Abdulaziz Ghuloum: "Re: Mandelbrot for the terminal"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Fri, 30 Jul 2004 21:39:05 +0000 (UTC)
Based on a Java program ( http://tinyurl.com/57smz ) I've implemented a
Lisp program for showing the Mandelbrot set:
(loop for y from -1 to 1.1 by 0.1 do
(loop for x from -2 to 1 by 0.04 do
(let* ((c 126)
(z (complex x y))
(a z))
(loop while (< (abs
(setq z (+ (* z z) a)))
2)
while (> (decf c) 32))
(princ (code-char c))))
(format t "~%"))
I tried to make it as short as possible and it is some chars shorter than
the Java program, if written in one line without much spaces. With CLISP,
the program is only 4 times slower than the Java program. Nice result, I
didn't expect this with my unoptimized program and using complex variables.
-- Frank Buß, fb@frank-buss.de http://www.frank-buss.de, http://www.it4-systems.de
- Next message: Edi Weitz: "Re: Mandelbrot for the terminal"
- Previous message: Rainer Joswig: "Re: Smaltalk, modify code on the fly..."
- Next in thread: Edi Weitz: "Re: Mandelbrot for the terminal"
- Reply: Edi Weitz: "Re: Mandelbrot for the terminal"
- Reply: Abdulaziz Ghuloum: "Re: Mandelbrot for the terminal"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|