solution/cw5/mand2.fun
changeset 894 02ef5c3abc51
parent 893 54a483a33763
child 895 2f5a87ecdc81
--- a/solution/cw5/mand2.fun	Fri Oct 28 09:08:13 2022 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,36 +0,0 @@
-// Mandelbrot program (with character constants)
-
-val Ymin: Double = -1.3;
-val Ymax: Double =  1.3;
-val Ystep: Double = 0.05;  //0.025;
-
-val Xmin: Double = -2.1;
-val Xmax: Double =  1.1;
-val Xstep: Double = 0.02;  //0.01;
-
-val Maxiters: Int = 1000;
-
-def m_iter(m: Int, x: Double, y: Double,
-                   zr: Double, zi: Double) : Void = {
-  if Maxiters <= m
-  then print_char(' ') 
-  else {
-    if 4.0 <= zi*zi+zr*zr then print_char('0' + (m % 10)) 
-    else m_iter(m + 1, x, y, x+zr*zr-zi*zi, 2.0*zr*zi+y) 
-  }
-};
-
-def x_iter(x: Double, y: Double) : Void = {
-  if x <= Xmax
-  then { m_iter(0, x, y, 0.0, 0.0) ; x_iter(x + Xstep, y) }
-  else skip()
-};
-
-def y_iter(y: Double) : Void = {
-  if y <= Ymax
-  then { x_iter(Xmin, y) ; print_char('\n') ; y_iter(y + Ystep) }
-  else skip() 
-};    
-
-
-y_iter(Ymin)
\ No newline at end of file