diff -r 97bcf8efe4e0 -r bb6074814a73 progs/mandelbrot.scala --- a/progs/mandelbrot.scala Fri Nov 06 01:07:26 2020 +0000 +++ b/progs/mandelbrot.scala Sat Nov 07 19:13:06 2020 +0000 @@ -90,7 +90,7 @@ // but might leave early when the pred is satisfied def iterations(c: Complex, max: Int) : Int = { def next(z: Complex) = z * z + c - def pred(z: Complex) = z.abs < 2 // exit condition + def pred(z: Complex) = z.abs() < 2 // exit condition LazyList.iterate(0.0 * i, max)(next).takeWhile(pred).size } @@ -133,6 +133,7 @@ } + // example 1 val exa1 = -2.0 + -1.5 * i val exa2 = 1.0 + 1.5 * i @@ -157,12 +158,10 @@ val delta = (exc2 - exc1) * 0.0333 -/* println(s"${time_needed( for (n <- (0 to 12)) mandelbrot(exc1 + delta * n, exc2 - delta * n, 100))} secs") -*/