Add all the A tasks
This commit is contained in:
parent
2dd7375f96
commit
051504d65b
1608 changed files with 18584 additions and 0 deletions
7
Task/Anonymous-recursion/Ruby/anonymous-recursion-4.rb
Normal file
7
Task/Anonymous-recursion/Ruby/anonymous-recursion-4.rb
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
# Ruby 1.9
|
||||
(-2..12).map { |i| fib i rescue :error }
|
||||
=> [:error, :error, 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144]
|
||||
|
||||
# Ruby 1.8
|
||||
(-2..12).map { |i| fib i rescue :error }
|
||||
=> [:error, :error, 0, 1, 0, -3, -8, -15, -24, -35, -48, -63, -80, -99, -120]
|
||||
Loading…
Add table
Add a link
Reference in a new issue