1. Factorial on RosettaCode
- Posted by bruce1961 Jan 31, 2011
- 2093 views
Okay, some of you aren't going to like the over-the-top way I did it, but it was an interesting experience all the same.
Kind regards, Bruce.
2. Re: Factorial on RosettaCode
- Posted by DerekParnell (admin) Jan 31, 2011
- 2069 views
Okay, some of you aren't going to like the over-the-top way I did it, but it was an interesting experience all the same.
Well, not so much as 'over the top' but not a good example of how Euphoria should be used to solve these problems. Your approach is a novelty and not really what I'd recommend to anyone who actually was considering Euphoria for problem solving.
3. Re: Factorial on RosettaCode
- Posted by AndyDrummond Jan 31, 2011
- 1970 views
Am I being particularly obtuse? I'd have thought the function would be simply:
function factorial(integer n) atom f f=1 while n do f*=n n-=1 end while return f end function
Putting in it's fewest lines, that is? Or is there a particularly nice Euphorian way to do that?
4. Re: Factorial on RosettaCode
- Posted by bruce1961 Jan 31, 2011
- 1890 views
but not a good example of how Euphoria should be used to solve these problems. Your approach is a novelty and not really what I'd recommend to anyone who actually was considering Euphoria for problem solving.
Hmmmm ... you do make a good case, Derek. I feel a bit embarrassed now.
Bruce.
5. Re: Factorial on RosettaCode
- Posted by bruce1961 Feb 06, 2011
- 1794 views
Hah! Finally, some justification for answering with more than just the bare minimum of code:
"As with any puzzle, try to do it in as creative/concise/comical a way as possible (simple, obvious solutions allowed, too)." - RosettaCode 99 Bottles of Beer