POV-Ray : Newsgroups : povray.general : Array... : Re: Array... Server Time
20 Nov 2024 06:39:05 EST (-0500)
  Re: Array...  
From: JRG
Date: 14 Oct 2001 17:07:16
Message: <3bc9fe84$1@news.povray.org>
"F.Audet" <flo### [at] sympaticoca> ha scritto nel messaggio
news:3BC9AFCA.9B469579@sympatico.ca...
>     Does anyone could give me
> some "basic" principles about Array !
>
> I draw a 3d zero and a 3d one,  which objects
> can be choosen randomly from a macro....
> The macro is done and works well.
> Each time I need a number,  the macro
> randomly return a zero or a one.
> I only need to put this "binary_01 ( )" macro
> inside an array,  say,  20*20.
>
>    Alex Pilote
>
> ...I know I could use a loop....

In fact:

#declare YOUR_ARRAY = array[20][20]
#declare i = 0;
#while (i<20)
#declare j=0;
#while (j<20)
#declare YOUR_ARRAY[i][j]= binary_01();
#declare j=j+1;
#end
#declare i=i+1;
#end

Done.


Post a reply to this message

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