Advertisement
Guest User

Untitled

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