Differences between revisions 1 and 3 (spanning 2 versions)
Revision 1 as of 2006-09-02 10:21:22
Size: 174
Editor: 211
Comment:
Revision 3 as of 2011-08-03 11:00:55
Size: 173
Editor: localhost
Comment: converted to 1.6 markup
Deletions are marked like this. Additions are marked like this.
Line 1: Line 1:
#format plain #format ruby
   1 def factorial(n)
   2   if n == 1
   3     return 1
   4   else
   5     return n * factorial(n-1)
   6   end
   7 end
   8 
   9 def factorial2(n)
  10   n == 1 ? 1 : n * factorial(n-1)
  11 end

Factorial.rb (last edited 2011-08-03 11:00:55 by localhost)

web biohackers.net