POV-Ray : Newsgroups : povray.advanced-users : Random number generator needed ! : Re: Random number generator needed ! Server Time
30 Jul 2024 02:21:28 EDT (-0400)
  Re: Random number generator needed !  
From: Warp
Date: 21 Feb 2001 12:40:52
Message: <3a93fda4@news.povray.org>
Rune <run### [at] inamecom> wrote:
: Basically it will never be of any use to use rand( seed( VAL ) ) no matter
: what "VAL" is, because it won't add any randomness at all.

  What he wanted was that a certain pair of values is converted to some
value (always the same value). Each time the function is called with a
certain pair of values, the same result is returned. This value should
be "random" in the way that there's no (easily) visible connection between
the input values and the result.
  For this rand(seed(VAL)) works quite well. It returns a value from 0 to 1
which is seemingly not related to VAL.

-- 
char*i="b[7FK@`3NB6>B:b3O6>:B:b3O6><`3:;8:6f733:>::b?7B>:>^B>C73;S1";
main(_,c,m){for(m=32;c=*i++-49;c&m?puts(""):m)for(_=(
c/4)&7;putchar(m),_--?m:(_=(1<<(c&3))-1,(m^=3)&3););}    /*- Warp -*/


Post a reply to this message

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