POV-Ray : Newsgroups : povray.general : a really dumb mistake : Re: a really dumb mistake Server Time
17 Apr 2024 20:09:27 EDT (-0400)
  Re: a really dumb mistake  
From: clipka
Date: 21 Aug 2017 12:01:06
Message: <599b03c2$1@news.povray.org>
Am 02.08.2017 um 21:07 schrieb Bald Eagle:
> "Kenneth" <kdw### [at] gmailcom> wrote:
> 
>> ---------------------------------
>> (The proper way to do it):
>> #declare MY_VALUE = 10;
>>
>> #declare C = 1;
>> #while(C < 20)
>> #if(even(C))
>> #declare MY_VALUE = 33;
>> #else
>> #declare MY_VALUE = 10;
>> #end
>> #debug concat("\n","My Value = ",str(MY_VALUE,1,0),"\n")
>> #declare C = C + 1;
>> #end
> 
> (The more efficient way to do it):
> 
> 
>  #declare C = 1;
>  #while(C < 20)
>  #declare MY_VALUE = 10;
>     #if(even(C))
>        #declare MY_VALUE = 33;
>     #end
>  #debug concat("\n","My Value = ",str(MY_VALUE,1,0),"\n")
>  #declare C = C + 1;
>  #end

Challenge accepted ;)

#declare MY_VALUE = 10;
#for(C,1,19)
  #debug concat("\n","My Value = ",str(MY_VALUE,1,0),"\n")
  #declare MY_VALUE = 43-MY_VALUE;
#end


Post a reply to this message

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