Thorsten Froehlich wrote:
> exceptions, but that is not the point). The example you provide is simply
> extremely bad programming style and it is neither a bug nor a limitation
> on part of POV-Ray that the above does not work.
If it is that bad programming style, how to do it the good way?? More
specific:
Return the first non-zero position of an array of length n - or if it is
all zero return n.
Can you do it without extra variable?
One solution working in pov is:
#declare goon=1;
#declare i=0;
#while ((i<n)&(goon=1))
#if (a[i]=0)
#declare i=i+1;
#else
#declare goon=0;
#end
#end
So this can impossible be better style. Please enlighten me with your
solution.
Post a reply to this message
|