POV-Ray : Newsgroups : povray.newusers : seed and rand : Re: seed and rand Server Time
2 Nov 2024 03:16:21 EDT (-0400)
  Re: seed and rand  
From: Jim Charter
Date: 9 Oct 2004 19:21:02
Message: <4168725e@news.povray.org>
I tested with this code and it seems to behave as advertised:

#declare Rnd=seed(0);
#declare Rnd1=seed(1);

#local i=0;#while(i<10)
         #debug #concat ( "\n Rnd: ", str( rand(Rnd),3,6 ) )
         #debug #concat ( "   Rnd2: ", str( rand(Rnd1),3,6 ) )
#local i=i+1;#end
#debug #concat ( "\n\n"   )

#declare Rnd=seed(0); //reset one of the seeds

#local i=0;#while(i<10)
         #debug #concat ( "\n Rnd: ", str( rand(Rnd),3,6 ) )
         #debug #concat ( "   Rnd2: ", str( rand(Rnd1),3,6 ) )
#local i=i+1;#end

#debug #concat ( "\n\n"   )

#declare Rnd=seed(0);  //reset
#declare Rnd1=seed(1);  //both seeds

#local i=0;#while(i<10)
         #debug #concat ( "\n Rnd: ", str( rand(Rnd),3,6 ) )
#local i=i+1;#end
#debug #concat ( "\n"   )
#local i=0;#while(i<10)
         #debug #concat ( "\n Rnd2: ", str( rand(Rnd1),3,6 ) )
#local i=i+1;#end


Post a reply to this message

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