Guest User

Untitled

a guest
Jul 30th, 2018
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Scheme 0.33 KB | None | 0 0
  1. #!/usr/bin/guile \
  2. -e main -s
  3. !#
  4.  
  5. (define (mandelbrot c n z)
  6.   (if (= n 0) z
  7.       (mandelbrot c (- n 1) (+ (* z z) c))))
  8.  
  9. (define (main args)
  10.   (let* ((n (string->number (cadr args)))
  11.      (debug (string= "debug" (caddr args)))
  12.      (c 0.04+0.01i)
  13.      (z0 0+0i)
  14.      (z (mandelbrot c n z0)))
  15.     (when debug (format #t "~a~%" z))))
Add Comment
Please, Sign In to add comment