move demo documents into separate files
This commit is contained in:
parent
8ee1ffab20
commit
426259dc2f
23 changed files with 466 additions and 495 deletions
12
demo/docs/ruby.rb
Normal file
12
demo/docs/ruby.rb
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
#!/usr/bin/ruby
|
||||
|
||||
# Program to find the factorial of a number
|
||||
def fact(n)
|
||||
if n == 0
|
||||
1
|
||||
else
|
||||
n * fact(n-1)
|
||||
end
|
||||
end
|
||||
|
||||
puts fact(ARGV[0].to_i)
|
||||
Loading…
Add table
Add a link
Reference in a new issue