Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- let rec mandelbrot cre cim zre zim its =
- let zre2 = zre *. zre in
- let zim2 = zim *. zim in
- if zre2 +. zim2 >= 4.0 then
- if its >= 32 then "·"
- else if its >= 16 then "*"
- else "#"
- else if its >= 1000000 then " "
- else mandelbrot cre cim (zre2 -. zim2 +. cre) (2.0 *. zre *. zim +. cim) (its + 1)
- ;;
- for y = 19 downto -20 do
- let cim = (float y) /. 20.0 in
- for x = -40 to 39 do
- let cre = (float x) /. 40.0 -. 0.5 in
- print_string (mandelbrot cre cim 0.0 0.0 0);
- done;
- print_endline ""
- done;;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement