POV-Ray : Newsgroups : povray.general : Math problem : Re: Math problem Server Time
12 Aug 2024 07:22:46 EDT (-0400)
  Re: Math problem  
From: Josh English
Date: 16 Mar 1999 12:40:36
Message: <36EE97FB.22C40B3E@spiritone.com>
Thank you. I figured it had to something obvious like that, I only couldn't admit
to it yesterday. Thank you.

I DID take programming courses at one point, granted it was a Modula-2 class, but
it was programming... that's what you forget over the years.



Spider wrote:

>  // initalize the array
>  #macro InitGrid ()
>    #local i = 0;
>    #while ( i < 10 )
>    #local j = 0;
> //RESET J HERE !!!
>      #while ( j < 10 )
>        #declare MyGrid[i][j] = 1;
>        #local j = j + 1;
>      #end
>      #local i = i + 1;
>    #end
>  #end
>
>  #macro DrawGrid ()
>    #local i = 0;
>    #while (i < 10 )
> //RESET J HERE !!!
>    #local j = 0;
>      #while ( j < 10 )
>        sphere { <i*2,2,j*2> MyGrid[i][j]
>                 pigment { red 1 }
>                 finish { phong 1 } }
>        #local j = j + 1;
>      #end
>      #local i = i + 1;
>    #end
>  #end
>
>
> I set the comments. Sorry for screaming :-)
> you only have to reinit J to 0 every outer loop, or it will only happen ince.
> And, use #local inside a macro.
> --
> //Spider
> ( spi### [at] bahnhofse ) [ http://www.bahnhof.se/~spider/ ]
> #declare life = rand(seed(42))*sqrt(-1);

--
Josh English
eng### [at] spiritonecom
www.spiritone.com/~english


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.