POV-Ray : Newsgroups : povray.general : Dynamic arrays : Re: Dynamic arrays Server Time
13 Aug 2024 01:15:28 EDT (-0400)
  Re: Dynamic arrays  
From: Nieminen Mika
Date: 7 Dec 1998 13:48:04
Message: <366c22e4.0@news.povray.org>
Margus Ramst <mar### [at] peakeduee> wrote:
: The subject kind of says it. I would like to see dynamic arrays (size not
: predefined) in POV, since there are always situations where one can't predict
: the size of an array.
: Comments, anybody?

  I think it's perfectly possible to make dynamic arrays with pov language.
  In pseudocode something like this:

// want to convert an array A with dimensions [2][3] to dimensions [4][5]
copy the array A to a temporary array B
undefine A
declare A as an array of [4][5]
copy the contents of array B to array A (#while-loops etc...)
undefine B

  A resize_array()-macro should be quite easy to make this way...

  It's slow, I know, but at least it's not impossible.

-- 
main(i){char*_="BdsyFBThhHFBThhHFRz]NFTITQF|DJIFHQhhF";while(i=
*_++)for(;i>1;printf("%s",i-70?i&1?"[]":" ":(i=0,"\n")),i/=2);} /*- Warp. -*/


Post a reply to this message

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