fork download
  1. def f(a,b,c)
  2. if a==0 and b==0
  3. c+1
  4. elsif c==0
  5. f(a,b-1,1)
  6. elsif b==0
  7. f(a-1,c,c)
  8. else
  9. f(a,b-1,f(a,b,c-1))
  10. end
  11. end
  12.  
  13. puts f(2,2,2)
Runtime error #stdin #stdout #stderr 4.84s 9696KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
prog.rb:5: stack level too deep (SystemStackError)