Advertisement
Guest User

Untitled

a guest
Feb 27th, 2015
265
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. let rec mandelbrot cre cim zre zim its =
  2. let zre2 = zre *. zre in
  3. let zim2 = zim *. zim in
  4. if zre2 +. zim2 >= 4.0 then
  5. if its >= 32 then "·"
  6. else if its >= 16 then "*"
  7. else "#"
  8. else if its >= 1000000 then " "
  9. else mandelbrot cre cim (zre2 -. zim2 +. cre) (2.0 *. zre *. zim +. cim) (its + 1)
  10. ;;
  11.  
  12. for y = 19 downto -20 do
  13. let cim = (float y) /. 20.0 in
  14. for x = -40 to 39 do
  15. let cre = (float x) /. 40.0 -. 0.5 in
  16. print_string (mandelbrot cre cim 0.0 0.0 0);
  17. done;
  18. print_endline ""
  19. done;;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement