POV-Ray : Newsgroups : povray.general : rand question : Re: rand question Server Time
5 Aug 2024 04:22:57 EDT (-0400)
  Re: rand question  
From: Tom Melly
Date: 12 Feb 2003 12:25:08
Message: <3e4a8374@news.povray.org>
"Tom Melly" <tom### [at] tomandlucouk> wrote in message
news:3e4a82f0$1@news.povray.org...

<snip>

Meanwhile, I'm still looking for my 3 numbers in a row.

Here's the code (and a clue;)....

#declare Found = false;
#declare Seed1 =  0;
#declare Count = 1;
#declare Searching = true;
#while(Searching)
  #declare Rand1 = seed(Seed1);
  #declare Val = rand(Rand1)*235;
  #if(int(Val) = 234)
    #declare Val = rand(Rand1)*235;
    #if(int(Val) = 85)
      #debug concat(str(Count,0,0),": B: ",str(int(Val),0,0), "\n")
      #declare Count = Count + 1;
      #declare Val = rand(Rand1)*235;
      #if(int(Val) = 81)
        #debug concat("C: ",str(int(Val),0,0), "\n")
        #debug concat("\n", "Seed = ",str(Seed1,0,0),"\n")
        #declare Searching = false;
      #end
    #end
  #end
  #declare Seed1 = Seed1 + 1;
#end

--
#macro A(V,B,C,R)#while(B-256)#if(V-128/B>=0)sphere{0,.5translate<C-4R-1,9>
pigment{rgb<1-C/8R/2C/8>}}#local V=V-128/B;#end#local B=B*2;#local C=C+1;#
end#end A(234,1,0,2)A(85,1,0,1)A(81,1,0,0)light_source{-5 1}//Tom Melly


Post a reply to this message

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