POV-Ray : Newsgroups : povray.advanced-users : "user-defined" isosurface : Re: "user-defined" isosurface Server Time
28 Jul 2024 10:19:42 EDT (-0400)
  Re: "user-defined" isosurface  
From: Leo80s
Date: 24 Jan 2006 05:50:00
Message: <web.43d605983f7154a3f20c7750@news.povray.org>
> #declare Factorial =
>   function(A) { select(A, 1, 1, A*Factorial(A-1)) };
>
> #declare Value = Factorial(8);
> #debug concat("Factorial of 8 is ", str(Value, 0, 0), "n")

Hi Warp,
I tried your piece of code and it works but I need to use recursion with
element of an array...so I've modified your code in this way:

#declare w= array [10];

....[assigning integer value to w elements]

#declare Factorial =
   function(A) { select(A, 1, 1, w[A]*Factorial(A-1)) };

compiling, I've obtained this error (related on w[A]):

Parse Error: Expected 'numeric expression', undeclared identified 'A' found
instead ...

But why??? A is sure not initialited (but it's a parameter...) but why
undeclared?!?!

Leo


Post a reply to this message

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