tech-userlevel archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: mksh import



> [...]  I've slightly rewritten that script to make it run on NetBSD's
> /bin/sh -- [...]

Please don't use paragraph-length lines.

That aside, does this really work?

> inmandelbrot() {
>     mag=$(($1 * $1 + $2 * $2))
>     if [ $mag -gt "40000" ] || [ $5 -ge $6 ]; then
>         echo $5
>     else
>         r=$((($1 * $1)/100 - ($2 * $2)/100 + $3))
>         i=$((($1 * $2)/100 * 2 + $4))
>         cnt=$(($5 + 1))
>         inmandelbrot r i $3 $4 $cnt $6
>     fi
> }

That looks as though it should be $r and $i in the recursive call.
Similarly, this

>         val=$(inmandelbrot rval ival rval ival 1 10)

looks as though it's missing four dollar signs.

Or Am I Missing Something (tm)?

/~\ The ASCII                             Mouse
\ / Ribbon Campaign
 X  Against HTML                mouse%rodents-montreal.org@localhost
/ \ Email!           7D C8 61 52 5D E7 2D 39  4E F1 31 3E E8 B3 27 4B


Home | Main Index | Thread Index | Old Index